From 9129e99f93af237d40c76024ae4da3d453530ff2 Mon Sep 17 00:00:00 2001 From: Philipp Grimm Date: Mon, 13 May 2024 13:11:46 +0200 Subject: [PATCH] test fire_last_message_received --- custom_components/eltako/gateway.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/eltako/gateway.py b/custom_components/eltako/gateway.py index 7c9649a6..4977def5 100644 --- a/custom_components/eltako/gateway.py +++ b/custom_components/eltako/gateway.py @@ -88,11 +88,12 @@ def __init__(self, general_settings:dict, hass: HomeAssistant, def set_connection_state_changed_handler(self, handler): self._connection_state_handler = handler + self._fire_connection_state_changed_event() - def _fire_connection_state_changed_event(self, connected:bool): + def _fire_connection_state_changed_event(self): event_id = config_helpers.get_bus_event_type(self.base_id, SIGNAL_GATEWAY_CONNECTION_STATUS) - dispatcher_send(self.hass, event_id, None) + dispatcher_send(self.hass, event_id, self._bus.is_active()) def set_last_message_received_handler(self, handler):