Fix Tado Power and Link binary sensors (#46235)

Power and Link aren't converted from strings to booleans by python-tado, so we
need to properly parse before assigning the string value to binary sensors.

Fixes: 067f2d0098 ("Add tado zone binary sensors (#44576)")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2021-02-08 22:49:46 +01:00 committed by GitHub
parent 71d7ae5992
commit fcae840641
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -244,10 +244,10 @@ class TadoZoneBinarySensor(TadoZoneEntity, BinarySensorEntity):
return
if self.zone_variable == "power":
self._state = self._tado_zone_data.power
self._state = self._tado_zone_data.power == "ON"
elif self.zone_variable == "link":
self._state = self._tado_zone_data.link
self._state = self._tado_zone_data.link == "ONLINE"
elif self.zone_variable == "overlay":
self._state = self._tado_zone_data.overlay_active