mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Cookidoo exotic domains (#134676)
This commit is contained in:
parent
cc0fb80481
commit
8a880d6134
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from cookidoo_api import Cookidoo, CookidooConfig, CookidooLocalizationConfig
|
from cookidoo_api import Cookidoo, CookidooConfig, get_localization_options
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_COUNTRY,
|
CONF_COUNTRY,
|
||||||
@ -22,15 +22,17 @@ PLATFORMS: list[Platform] = [Platform.BUTTON, Platform.TODO]
|
|||||||
async def async_setup_entry(hass: HomeAssistant, entry: CookidooConfigEntry) -> bool:
|
async def async_setup_entry(hass: HomeAssistant, entry: CookidooConfigEntry) -> bool:
|
||||||
"""Set up Cookidoo from a config entry."""
|
"""Set up Cookidoo from a config entry."""
|
||||||
|
|
||||||
|
localizations = await get_localization_options(
|
||||||
|
country=entry.data[CONF_COUNTRY].lower(),
|
||||||
|
language=entry.data[CONF_LANGUAGE],
|
||||||
|
)
|
||||||
|
|
||||||
cookidoo = Cookidoo(
|
cookidoo = Cookidoo(
|
||||||
async_get_clientsession(hass),
|
async_get_clientsession(hass),
|
||||||
CookidooConfig(
|
CookidooConfig(
|
||||||
email=entry.data[CONF_EMAIL],
|
email=entry.data[CONF_EMAIL],
|
||||||
password=entry.data[CONF_PASSWORD],
|
password=entry.data[CONF_PASSWORD],
|
||||||
localization=CookidooLocalizationConfig(
|
localization=localizations[0],
|
||||||
country_code=entry.data[CONF_COUNTRY].lower(),
|
|
||||||
language=entry.data[CONF_LANGUAGE],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ from cookidoo_api import (
|
|||||||
Cookidoo,
|
Cookidoo,
|
||||||
CookidooAuthException,
|
CookidooAuthException,
|
||||||
CookidooConfig,
|
CookidooConfig,
|
||||||
CookidooLocalizationConfig,
|
|
||||||
CookidooRequestException,
|
CookidooRequestException,
|
||||||
get_country_options,
|
get_country_options,
|
||||||
get_localization_options,
|
get_localization_options,
|
||||||
@ -219,18 +218,19 @@ class CookidooConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
else:
|
else:
|
||||||
data_input[CONF_LANGUAGE] = (
|
data_input[CONF_LANGUAGE] = (
|
||||||
await get_localization_options(country=data_input[CONF_COUNTRY].lower())
|
await get_localization_options(country=data_input[CONF_COUNTRY].lower())
|
||||||
)[0] # Pick any language to test login
|
)[0].language # Pick any language to test login
|
||||||
|
|
||||||
|
localizations = await get_localization_options(
|
||||||
|
country=data_input[CONF_COUNTRY].lower(),
|
||||||
|
language=data_input[CONF_LANGUAGE],
|
||||||
|
)
|
||||||
|
|
||||||
session = async_get_clientsession(self.hass)
|
|
||||||
cookidoo = Cookidoo(
|
cookidoo = Cookidoo(
|
||||||
session,
|
async_get_clientsession(self.hass),
|
||||||
CookidooConfig(
|
CookidooConfig(
|
||||||
email=data_input[CONF_EMAIL],
|
email=data_input[CONF_EMAIL],
|
||||||
password=data_input[CONF_PASSWORD],
|
password=data_input[CONF_PASSWORD],
|
||||||
localization=CookidooLocalizationConfig(
|
localization=localizations[0],
|
||||||
country_code=data_input[CONF_COUNTRY].lower(),
|
|
||||||
language=data_input[CONF_LANGUAGE],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
@ -8,5 +8,5 @@
|
|||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["cookidoo_api"],
|
"loggers": ["cookidoo_api"],
|
||||||
"quality_scale": "silver",
|
"quality_scale": "silver",
|
||||||
"requirements": ["cookidoo-api==0.11.1"]
|
"requirements": ["cookidoo-api==0.11.2"]
|
||||||
}
|
}
|
||||||
|
@ -710,7 +710,7 @@ connect-box==0.3.1
|
|||||||
construct==2.10.68
|
construct==2.10.68
|
||||||
|
|
||||||
# homeassistant.components.cookidoo
|
# homeassistant.components.cookidoo
|
||||||
cookidoo-api==0.11.1
|
cookidoo-api==0.11.2
|
||||||
|
|
||||||
# homeassistant.components.backup
|
# homeassistant.components.backup
|
||||||
# homeassistant.components.utility_meter
|
# homeassistant.components.utility_meter
|
||||||
|
@ -606,7 +606,7 @@ colorthief==0.2.1
|
|||||||
construct==2.10.68
|
construct==2.10.68
|
||||||
|
|
||||||
# homeassistant.components.cookidoo
|
# homeassistant.components.cookidoo
|
||||||
cookidoo-api==0.11.1
|
cookidoo-api==0.11.2
|
||||||
|
|
||||||
# homeassistant.components.backup
|
# homeassistant.components.backup
|
||||||
# homeassistant.components.utility_meter
|
# homeassistant.components.utility_meter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user