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 5af1eaf commit 7fb07a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/eltako/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ def _fire_last_message_received_event(self):
# 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) )
self.hass.async_add_executor_job(
self._last_message_received_handler( datetime.utcnow().replace(tzinfo=pytz.utc) )
)


def set_received_message_count_handler(self, handler):
Expand All @@ -118,7 +120,9 @@ def _fire_received_message_count_event(self):
# self.hass.async_create_task(
# self._received_message_count_handler( self._received_message_count )
# )
self._received_message_count_handler( self._received_message_count )
self.hass.async_add_executor_job(
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 7fb07a5

Please sign in to comment.