Skip to content

Commit

Permalink
Update AEMET-OpenData to v0.6.3 (#131303)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noltari authored Nov 23, 2024
1 parent 460ce24 commit 0033ce4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions homeassistant/components/aemet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/aemet/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def async_step_user(
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)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/aemet/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0033ce4

Please sign in to comment.