FHEM & reconnecting client fixes

This commit is contained in:
Martin Bauer
2019-07-07 17:30:45 +02:00
parent 06f96cb2dc
commit e6f5504181
8 changed files with 34 additions and 13 deletions

View File

@@ -41,9 +41,7 @@ class FhemConnection(ReconnectingClient):
def register_device(self, id, d):
self._devices[id].append(d)
if self._writer:
self._writer.writelines([
"displayattr .*\n".encode(),
])
d.refresh()
async def _update_all_devices(self, state):
if state == 'connected':
@@ -51,6 +49,7 @@ class FhemConnection(ReconnectingClient):
self.write_line("inform on")
for device_list in self._devices.values():
for device in device_list:
device.refresh()
await device.async_update_ha_state()
async def _process_line(self, line):