mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 16:17:20 +00:00
Update AEMET-OpenData to v0.6.3 (#131303)
This commit is contained in:
parent
460ce2463d
commit
0033ce4f96
@ -3,7 +3,7 @@
|
||||
import logging
|
||||
|
||||
from aemet_opendata.exceptions import AemetError, TownNotFound
|
||||
from aemet_opendata.interface import AEMET, ConnectionOptions
|
||||
from aemet_opendata.interface import AEMET, ConnectionOptions, UpdateFeature
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME
|
||||
@ -23,9 +23,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: AemetConfigEntry) -> boo
|
||||
api_key = entry.data[CONF_API_KEY]
|
||||
latitude = entry.data[CONF_LATITUDE]
|
||||
longitude = entry.data[CONF_LONGITUDE]
|
||||
station_updates = entry.options.get(CONF_STATION_UPDATES, True)
|
||||
update_features: int = UpdateFeature.FORECAST
|
||||
if entry.options.get(CONF_STATION_UPDATES, True):
|
||||
update_features |= UpdateFeature.STATION
|
||||
|
||||
options = ConnectionOptions(api_key, station_updates)
|
||||
options = ConnectionOptions(api_key, update_features)
|
||||
aemet = AEMET(aiohttp_client.async_get_clientsession(hass), options)
|
||||
try:
|
||||
await aemet.select_coordinates(latitude, longitude)
|
||||
|
@ -45,7 +45,7 @@ class AemetConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
await self.async_set_unique_id(f"{latitude}-{longitude}")
|
||||
self._abort_if_unique_id_configured()
|
||||
|
||||
options = ConnectionOptions(user_input[CONF_API_KEY], False)
|
||||
options = ConnectionOptions(user_input[CONF_API_KEY])
|
||||
aemet = AEMET(aiohttp_client.async_get_clientsession(self.hass), options)
|
||||
try:
|
||||
await aemet.select_coordinates(latitude, longitude)
|
||||
|
@ -6,5 +6,5 @@
|
||||
"documentation": "https://www.home-assistant.io/integrations/aemet",
|
||||
"iot_class": "cloud_polling",
|
||||
"loggers": ["aemet_opendata"],
|
||||
"requirements": ["AEMET-OpenData==0.6.2"]
|
||||
"requirements": ["AEMET-OpenData==0.6.3"]
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
-r requirements.txt
|
||||
|
||||
# homeassistant.components.aemet
|
||||
AEMET-OpenData==0.6.2
|
||||
AEMET-OpenData==0.6.3
|
||||
|
||||
# homeassistant.components.honeywell
|
||||
AIOSomecomfort==0.0.25
|
||||
|
@ -4,7 +4,7 @@
|
||||
-r requirements_test.txt
|
||||
|
||||
# homeassistant.components.aemet
|
||||
AEMET-OpenData==0.6.2
|
||||
AEMET-OpenData==0.6.3
|
||||
|
||||
# homeassistant.components.honeywell
|
||||
AIOSomecomfort==0.0.25
|
||||
|
Loading…
x
Reference in New Issue
Block a user