diff --git a/changes.md b/changes.md index 7b18fb7c..0e8f556e 100644 --- a/changes.md +++ b/changes.md @@ -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/). diff --git a/custom_components/eltako/gateway.py b/custom_components/eltako/gateway.py index 729e94cd..09d9e7a3 100644 --- a/custom_components/eltako/gateway.py +++ b/custom_components/eltako/gateway.py @@ -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): @@ -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!)"""