Bump PyTado to 0.10.0 (#44770)

* Bump PyTado to v0.10.0

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* Tado: switch to getDeviceInfo

This function has been introduced in version 0.10.0 of PyTado.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* Tado: update tests

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2021-01-04 03:53:15 +01:00 committed by GitHub
parent 2bd8ee34f4
commit ec926105a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 42 additions and 11 deletions

View file

@ -157,10 +157,10 @@ class TadoDeviceBinarySensor(TadoDeviceEntity, BinarySensorEntity):
@callback
def _async_update_device_data(self):
"""Handle update callbacks."""
for device in self._tado.devices:
if device["serialNo"] == self.device_id:
self._device_info = device
break
try:
self._device_info = self._tado.data["device"][self.device_id]
except KeyError:
return
if self.device_variable == "battery state":
self._state = self._device_info["batteryState"] == "LOW"