Add Tado user agent (#145637)

This commit is contained in:
Erwin Douna 2025-05-26 21:04:46 +02:00 committed by GitHub
parent b667fb2728
commit 0b6ea36e24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 5 deletions

View File

@ -8,7 +8,13 @@ import PyTado.exceptions
from PyTado.interface import Tado from PyTado.interface import Tado
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform from homeassistant.const import (
APPLICATION_NAME,
CONF_PASSWORD,
CONF_USERNAME,
Platform,
__version__ as HA_VERSION,
)
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ( from homeassistant.exceptions import (
ConfigEntryAuthFailed, ConfigEntryAuthFailed,
@ -74,7 +80,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: TadoConfigEntry) -> bool
def create_tado_instance() -> tuple[Tado, str]: def create_tado_instance() -> tuple[Tado, str]:
"""Create a Tado instance, this time with a previously obtained refresh token.""" """Create a Tado instance, this time with a previously obtained refresh token."""
tado = Tado(saved_refresh_token=entry.data[CONF_REFRESH_TOKEN]) tado = Tado(
saved_refresh_token=entry.data[CONF_REFRESH_TOKEN],
user_agent=f"{APPLICATION_NAME}/{HA_VERSION}",
)
return tado, tado.device_activation_status() return tado, tado.device_activation_status()
try: try:

View File

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

2
requirements_all.txt generated
View File

@ -2507,7 +2507,7 @@ python-snoo==0.6.6
python-songpal==0.16.2 python-songpal==0.16.2
# homeassistant.components.tado # homeassistant.components.tado
python-tado==0.18.14 python-tado==0.18.15
# homeassistant.components.technove # homeassistant.components.technove
python-technove==2.0.0 python-technove==2.0.0

View File

@ -2047,7 +2047,7 @@ python-snoo==0.6.6
python-songpal==0.16.2 python-songpal==0.16.2
# homeassistant.components.tado # homeassistant.components.tado
python-tado==0.18.14 python-tado==0.18.15
# homeassistant.components.technove # homeassistant.components.technove
python-technove==2.0.0 python-technove==2.0.0