mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Update AEMET-OpenData to v0.4.6 (#102996)
This commit is contained in:
parent
bdfb138b09
commit
cb0517d20e
@ -1,9 +1,8 @@
|
||||
"""The AEMET OpenData component."""
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from aemet_opendata.exceptions import TownNotFound
|
||||
from aemet_opendata.exceptions import AemetError, TownNotFound
|
||||
from aemet_opendata.interface import AEMET, ConnectionOptions
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
@ -39,8 +38,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
except TownNotFound as err:
|
||||
_LOGGER.error(err)
|
||||
return False
|
||||
except asyncio.TimeoutError as err:
|
||||
raise ConfigEntryNotReady("AEMET OpenData API timed out") from err
|
||||
except AemetError as err:
|
||||
raise ConfigEntryNotReady(err) from err
|
||||
|
||||
weather_coordinator = WeatherUpdateCoordinator(hass, aemet)
|
||||
await weather_coordinator.async_config_entry_first_refresh()
|
||||
|
@ -6,5 +6,5 @@
|
||||
"documentation": "https://www.home-assistant.io/integrations/aemet",
|
||||
"iot_class": "cloud_polling",
|
||||
"loggers": ["aemet_opendata"],
|
||||
"requirements": ["AEMET-OpenData==0.4.5"]
|
||||
"requirements": ["AEMET-OpenData==0.4.6"]
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
-r requirements.txt
|
||||
|
||||
# homeassistant.components.aemet
|
||||
AEMET-OpenData==0.4.5
|
||||
AEMET-OpenData==0.4.6
|
||||
|
||||
# homeassistant.components.aladdin_connect
|
||||
AIOAladdinConnect==0.1.58
|
||||
|
@ -4,7 +4,7 @@
|
||||
-r requirements_test.txt
|
||||
|
||||
# homeassistant.components.aemet
|
||||
AEMET-OpenData==0.4.5
|
||||
AEMET-OpenData==0.4.6
|
||||
|
||||
# homeassistant.components.aladdin_connect
|
||||
AIOAladdinConnect==0.1.58
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Define tests for the AEMET OpenData init."""
|
||||
import asyncio
|
||||
from unittest.mock import patch
|
||||
|
||||
from aemet_opendata.exceptions import AemetTimeout
|
||||
from freezegun.api import FrozenDateTimeFactory
|
||||
|
||||
from homeassistant.components.aemet.const import DOMAIN
|
||||
@ -83,7 +83,7 @@ async def test_init_api_timeout(
|
||||
freezer.move_to("2021-01-09 12:00:00+00:00")
|
||||
with patch(
|
||||
"homeassistant.components.aemet.AEMET.api_call",
|
||||
side_effect=asyncio.TimeoutError,
|
||||
side_effect=AemetTimeout,
|
||||
):
|
||||
config_entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
|
Loading…
x
Reference in New Issue
Block a user