add new events, fix binsensor

This commit is contained in:
Andrey
2021-01-27 21:40:55 +03:00
parent a7d7738a5c
commit 6d3391bc45
9 changed files with 124 additions and 47 deletions

View File

@@ -78,7 +78,7 @@ class MegaBinarySensor(BinarySensorEntity, MegaPushEntity):
if val is None and self._state is not None:
return self._state == 'ON'
elif val is not None:
return val == 'ON' or val == 1
return val == 'ON' or val != 1
def _update(self, payload: dict):
self.mega.values[self.port] = payload