diff --git a/custom_components/eltako/gateway.py b/custom_components/eltako/gateway.py index 09d9e7a3..ccdfcf84 100644 --- a/custom_components/eltako/gateway.py +++ b/custom_components/eltako/gateway.py @@ -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): @@ -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!)"""