diff --git a/custom_components/fhem/__init__.py b/custom_components/fhem/__init__.py index c94c823..b031c4a 100644 --- a/custom_components/fhem/__init__.py +++ b/custom_components/fhem/__init__.py @@ -45,7 +45,10 @@ class FhemConnection(ReconnectingClient): "displayattr .*\n".encode(), ]) - async def _update_all_devices(self, _): + async def _update_all_devices(self, state): + if state == 'connected': + self.write_line("displayattr .*") + self.write_line("inform on") for device_list in self._devices.values(): for device in device_list: await device.async_update_ha_state() diff --git a/custom_components/lirc_network/__init__.py b/custom_components/lirc_network/__init__.py index 5d3fe21..50dd57c 100644 --- a/custom_components/lirc_network/__init__.py +++ b/custom_components/lirc_network/__init__.py @@ -22,7 +22,6 @@ CONFIG_SCHEMA = vol.Schema({ async def async_setup(hass, config): - _LOGGER.warning(f"Config is {config[DOMAIN]}") for config_element in config[DOMAIN]: connection = LircConnection(hass, config_element) await connection.start() diff --git a/custom_components/reconnecting_client.py b/custom_components/reconnecting_client.py index dae32b1..71bb3a3 100644 --- a/custom_components/reconnecting_client.py +++ b/custom_components/reconnecting_client.py @@ -48,10 +48,6 @@ class ReconnectingClient: await self._connection_status_changed_callback('connected') self.reconnect_time = self.reconnect_time_start - writer.writelines([ - "displayattr .*\n".encode(), - "inform on\n".encode(), - ]) while self._run: line = await reader.readline() if not line: