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):