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

@@ -72,6 +72,9 @@ class FhemLight(Light):
else:
return None
def refresh(self):
self.connection.fhem_set(self._ids[0], 'statusRequest')
async def async_turn_on(self, **kwargs):
brightness = kwargs.get(ATTR_BRIGHTNESS, None)
transition_time = kwargs.get(ATTR_TRANSITION, 0.5)
@@ -124,6 +127,7 @@ class FhemLight(Light):
pass
await self.async_update_ha_state()
elif line.startswith('ResndFail') or line.startswith('MISSING ACK'):
_LOGGER.warning(f"FHEM light {self.name} became unavailable: '{line}'")
self._available = False
await self.async_update_ha_state()
else: