FHEM & reconnecting client fixes
This commit is contained in:
@@ -60,6 +60,9 @@ class FhemSensor(Entity):
|
||||
def state(self):
|
||||
return self._state
|
||||
|
||||
def refresh(self):
|
||||
pass
|
||||
|
||||
async def line_received(self, line):
|
||||
if self._type == 'brightness' and line.startswith('brightness'):
|
||||
self._available = True
|
||||
@@ -69,7 +72,7 @@ class FhemSensor(Entity):
|
||||
elif self._type == 'power' and line.startswith('power'):
|
||||
self._available = True
|
||||
_, new_value = line.split(':')
|
||||
self._state = int(new_value)
|
||||
self._state = float(new_value)
|
||||
await self.async_update_ha_state()
|
||||
elif line.startswith('ResndFail') or line.startswith('MISSING ACK'):
|
||||
self._available = False
|
||||
|
||||
Reference in New Issue
Block a user