mirror of
https://github.com/andvikt/mega_hacs.git
synced 2026-02-04 08:27:48 +05:00
fix binary sensors
This commit is contained in:
@@ -78,7 +78,10 @@ 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
|
||||
if val in ['ON', 'OFF']:
|
||||
return val == 'ON'
|
||||
else:
|
||||
return val != 1
|
||||
|
||||
def _update(self, payload: dict):
|
||||
self.mega.values[self.port] = payload
|
||||
|
||||
Reference in New Issue
Block a user