mirror of
https://github.com/home-assistant/core.git
synced 2025-06-25 01:21:51 +02:00
Add Tado user agent (#145637)
This commit is contained in:
@ -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:
|
||||
|
@ -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
2
requirements_all.txt
generated
@ -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
|
||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -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
|
||||
|
Reference in New Issue
Block a user