mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Add Tado user agent (#145637)
This commit is contained in:
parent
b667fb2728
commit
0b6ea36e24
@ -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:
|
||||||
|
@ -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
2
requirements_all.txt
generated
@ -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
|
||||||
|
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
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user