Skip to content

Commit

Permalink
test fire_last_message_received
Browse files Browse the repository at this point in the history
  • Loading branch information
grimmpp committed May 13, 2024
1 parent 8f7f255 commit 5af1eaf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Version 1.4.2 Added EEPs A5-30-01 and A5-30-03
* Added EEPs (A5-30-01 preferred) for digital input which is used in water sensor (FSM60B)
* Incompatibility with HA 2024.5 fixed. (Thread safety checks)

## Version 1.4.1 Support for sending arbitrary messages
* Added Service for sending arbitrary EnOcean (ESP2) messages. Intended to be used in conjunction with [Home Assistant Automations](https://www.home-assistant.io/getting-started/automation/).
Expand Down
14 changes: 8 additions & 6 deletions custom_components/eltako/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ def set_last_message_received_handler(self, handler):

def _fire_last_message_received_event(self):
if self._last_message_received_handler:
self.hass.async_create_task(
self._last_message_received_handler( datetime.utcnow().replace(tzinfo=pytz.utc) )
)
# self.hass.async_create_task(
# self._last_message_received_handler( datetime.utcnow().replace(tzinfo=pytz.utc) )
# )
self._last_message_received_handler( datetime.utcnow().replace(tzinfo=pytz.utc) )


def set_received_message_count_handler(self, handler):
Expand All @@ -114,9 +115,10 @@ def set_received_message_count_handler(self, handler):
def _fire_received_message_count_event(self):
self._received_message_count += 1
if self._received_message_count_handler:
self.hass.async_create_task(
self._received_message_count_handler( self._received_message_count )
)
# self.hass.async_create_task(
# self._received_message_count_handler( self._received_message_count )
# )
self._received_message_count_handler( self._received_message_count )

def process_messages(self, data):
"""Received message from bus in HA loop. (Actions needs to run outside bus thread!)"""
Expand Down

0 comments on commit 5af1eaf

Please sign in to comment.