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
4 changed files with 14 additions and 5 deletions

View File

@ -8,7 +8,13 @@ import PyTado.exceptions
from PyTado.interface import Tado
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.exceptions import (
ConfigEntryAuthFailed,
@ -74,7 +80,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: TadoConfigEntry) -> bool
def create_tado_instance() -> tuple[Tado, str]:
"""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()
try:

View File

@ -14,5 +14,5 @@
},
"iot_class": "cloud_polling",
"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
# homeassistant.components.tado
python-tado==0.18.14
python-tado==0.18.15
# homeassistant.components.technove
python-technove==2.0.0

View File

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