Bump PyTado to 0.17.0 (#105573)

This commit is contained in:
Erwin Douna 2023-12-12 20:52:59 +01:00 committed by GitHub
parent d33aa6b8e7
commit 32147dbdd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 23 deletions

View File

@ -164,11 +164,10 @@ class TadoConnector:
def setup(self): def setup(self):
"""Connect to Tado and fetch the zones.""" """Connect to Tado and fetch the zones."""
self.tado = Tado(self._username, self._password) self.tado = Tado(self._username, self._password)
self.tado.setDebugging(True)
# Load zones and devices # Load zones and devices
self.zones = self.tado.getZones() self.zones = self.tado.get_zones()
self.devices = self.tado.getDevices() self.devices = self.tado.get_devices()
tado_home = self.tado.getMe()["homes"][0] tado_home = self.tado.get_me()["homes"][0]
self.home_id = tado_home["id"] self.home_id = tado_home["id"]
self.home_name = tado_home["name"] self.home_name = tado_home["name"]
@ -182,7 +181,7 @@ class TadoConnector:
def update_devices(self): def update_devices(self):
"""Update the device data from Tado.""" """Update the device data from Tado."""
try: try:
devices = self.tado.getDevices() devices = self.tado.get_devices()
except RuntimeError: except RuntimeError:
_LOGGER.error("Unable to connect to Tado while updating devices") _LOGGER.error("Unable to connect to Tado while updating devices")
return return
@ -195,7 +194,7 @@ class TadoConnector:
INSIDE_TEMPERATURE_MEASUREMENT INSIDE_TEMPERATURE_MEASUREMENT
in device["characteristics"]["capabilities"] in device["characteristics"]["capabilities"]
): ):
device[TEMP_OFFSET] = self.tado.getDeviceInfo( device[TEMP_OFFSET] = self.tado.get_device_info(
device_short_serial_no, TEMP_OFFSET device_short_serial_no, TEMP_OFFSET
) )
except RuntimeError: except RuntimeError:
@ -223,7 +222,7 @@ class TadoConnector:
def update_zones(self): def update_zones(self):
"""Update the zone data from Tado.""" """Update the zone data from Tado."""
try: try:
zone_states = self.tado.getZoneStates()["zoneStates"] zone_states = self.tado.get_zone_states()["zoneStates"]
except RuntimeError: except RuntimeError:
_LOGGER.error("Unable to connect to Tado while updating zones") _LOGGER.error("Unable to connect to Tado while updating zones")
return return
@ -235,7 +234,7 @@ class TadoConnector:
"""Update the internal data from Tado.""" """Update the internal data from Tado."""
_LOGGER.debug("Updating zone %s", zone_id) _LOGGER.debug("Updating zone %s", zone_id)
try: try:
data = self.tado.getZoneState(zone_id) data = self.tado.get_zone_state(zone_id)
except RuntimeError: except RuntimeError:
_LOGGER.error("Unable to connect to Tado while updating zone %s", zone_id) _LOGGER.error("Unable to connect to Tado while updating zone %s", zone_id)
return return
@ -256,8 +255,8 @@ class TadoConnector:
def update_home(self): def update_home(self):
"""Update the home data from Tado.""" """Update the home data from Tado."""
try: try:
self.data["weather"] = self.tado.getWeather() self.data["weather"] = self.tado.get_weather()
self.data["geofence"] = self.tado.getHomeState() self.data["geofence"] = self.tado.get_home_state()
dispatcher_send( dispatcher_send(
self.hass, self.hass,
SIGNAL_TADO_UPDATE_RECEIVED.format(self.home_id, "home", "data"), SIGNAL_TADO_UPDATE_RECEIVED.format(self.home_id, "home", "data"),
@ -270,15 +269,15 @@ class TadoConnector:
def get_capabilities(self, zone_id): def get_capabilities(self, zone_id):
"""Return the capabilities of the devices.""" """Return the capabilities of the devices."""
return self.tado.getCapabilities(zone_id) return self.tado.get_capabilities(zone_id)
def get_auto_geofencing_supported(self): def get_auto_geofencing_supported(self):
"""Return whether the Tado Home supports auto geofencing.""" """Return whether the Tado Home supports auto geofencing."""
return self.tado.getAutoGeofencingSupported() return self.tado.get_auto_geofencing_supported()
def reset_zone_overlay(self, zone_id): def reset_zone_overlay(self, zone_id):
"""Reset the zone back to the default operation.""" """Reset the zone back to the default operation."""
self.tado.resetZoneOverlay(zone_id) self.tado.reset_zone_overlay(zone_id)
self.update_zone(zone_id) self.update_zone(zone_id)
def set_presence( def set_presence(
@ -287,11 +286,11 @@ class TadoConnector:
): ):
"""Set the presence to home, away or auto.""" """Set the presence to home, away or auto."""
if presence == PRESET_AWAY: if presence == PRESET_AWAY:
self.tado.setAway() self.tado.set_away()
elif presence == PRESET_HOME: elif presence == PRESET_HOME:
self.tado.setHome() self.tado.set_home()
elif presence == PRESET_AUTO: elif presence == PRESET_AUTO:
self.tado.setAuto() self.tado.set_auto()
# Update everything when changing modes # Update everything when changing modes
self.update_zones() self.update_zones()
@ -325,7 +324,7 @@ class TadoConnector:
) )
try: try:
self.tado.setZoneOverlay( self.tado.set_zone_overlay(
zone_id, zone_id,
overlay_mode, overlay_mode,
temperature, temperature,
@ -333,7 +332,7 @@ class TadoConnector:
device_type, device_type,
"ON", "ON",
mode, mode,
fanSpeed=fan_speed, fan_speed=fan_speed,
swing=swing, swing=swing,
) )
@ -345,7 +344,7 @@ class TadoConnector:
def set_zone_off(self, zone_id, overlay_mode, device_type="HEATING"): def set_zone_off(self, zone_id, overlay_mode, device_type="HEATING"):
"""Set a zone to off.""" """Set a zone to off."""
try: try:
self.tado.setZoneOverlay( self.tado.set_zone_overlay(
zone_id, overlay_mode, None, None, device_type, "OFF" zone_id, overlay_mode, None, None, device_type, "OFF"
) )
except RequestException as exc: except RequestException as exc:
@ -356,6 +355,6 @@ class TadoConnector:
def set_temperature_offset(self, device_id, offset): def set_temperature_offset(self, device_id, offset):
"""Set temperature offset of device.""" """Set temperature offset of device."""
try: try:
self.tado.setTempOffset(device_id, offset) self.tado.set_temp_offset(device_id, offset)
except RequestException as exc: except RequestException as exc:
_LOGGER.error("Could not set temperature offset: %s", exc) _LOGGER.error("Could not set temperature offset: %s", exc)

View File

@ -14,5 +14,5 @@
}, },
"iot_class": "cloud_polling", "iot_class": "cloud_polling",
"loggers": ["PyTado"], "loggers": ["PyTado"],
"requirements": ["python-tado==0.15.0"] "requirements": ["python-tado==0.17.0"]
} }

View File

@ -2222,7 +2222,7 @@ python-smarttub==0.0.36
python-songpal==0.16 python-songpal==0.16
# homeassistant.components.tado # homeassistant.components.tado
python-tado==0.15.0 python-tado==0.17.0
# homeassistant.components.telegram_bot # homeassistant.components.telegram_bot
python-telegram-bot==13.1 python-telegram-bot==13.1

View File

@ -1670,7 +1670,7 @@ python-smarttub==0.0.36
python-songpal==0.16 python-songpal==0.16
# homeassistant.components.tado # homeassistant.components.tado
python-tado==0.15.0 python-tado==0.17.0
# homeassistant.components.telegram_bot # homeassistant.components.telegram_bot
python-telegram-bot==13.1 python-telegram-bot==13.1