mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Bump gios library to version 0.1.1 (#33569)
This commit is contained in:
parent
2d751c1edd
commit
b5c89b4ef4
@ -3,7 +3,7 @@ import logging
|
|||||||
|
|
||||||
from aiohttp.client_exceptions import ClientConnectorError
|
from aiohttp.client_exceptions import ClientConnectorError
|
||||||
from async_timeout import timeout
|
from async_timeout import timeout
|
||||||
from gios import ApiError, Gios, NoStationError
|
from gios import ApiError, Gios, InvalidSensorsData, NoStationError
|
||||||
|
|
||||||
from homeassistant.core import Config, HomeAssistant
|
from homeassistant.core import Config, HomeAssistant
|
||||||
from homeassistant.exceptions import ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
@ -63,7 +63,12 @@ class GiosDataUpdateCoordinator(DataUpdateCoordinator):
|
|||||||
try:
|
try:
|
||||||
with timeout(30):
|
with timeout(30):
|
||||||
await self.gios.update()
|
await self.gios.update()
|
||||||
except (ApiError, NoStationError, ClientConnectorError) as error:
|
except (
|
||||||
|
ApiError,
|
||||||
|
NoStationError,
|
||||||
|
ClientConnectorError,
|
||||||
|
InvalidSensorsData,
|
||||||
|
) as error:
|
||||||
raise UpdateFailed(error)
|
raise UpdateFailed(error)
|
||||||
if not self.gios.data:
|
if not self.gios.data:
|
||||||
raise UpdateFailed("Invalid sensors data")
|
raise UpdateFailed("Invalid sensors data")
|
||||||
|
@ -3,10 +3,10 @@ import asyncio
|
|||||||
|
|
||||||
from aiohttp.client_exceptions import ClientConnectorError
|
from aiohttp.client_exceptions import ClientConnectorError
|
||||||
from async_timeout import timeout
|
from async_timeout import timeout
|
||||||
from gios import ApiError, Gios, NoStationError
|
from gios import ApiError, Gios, InvalidSensorsData, NoStationError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import config_entries, exceptions
|
from homeassistant import config_entries
|
||||||
from homeassistant.const import CONF_NAME
|
from homeassistant.const import CONF_NAME
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
|
|
||||||
@ -43,9 +43,6 @@ class GiosFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
gios = Gios(user_input[CONF_STATION_ID], websession)
|
gios = Gios(user_input[CONF_STATION_ID], websession)
|
||||||
await gios.update()
|
await gios.update()
|
||||||
|
|
||||||
if not gios.available:
|
|
||||||
raise InvalidSensorsData()
|
|
||||||
|
|
||||||
return self.async_create_entry(
|
return self.async_create_entry(
|
||||||
title=user_input[CONF_STATION_ID], data=user_input,
|
title=user_input[CONF_STATION_ID], data=user_input,
|
||||||
)
|
)
|
||||||
@ -59,7 +56,3 @@ class GiosFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
return self.async_show_form(
|
return self.async_show_form(
|
||||||
step_id="user", data_schema=DATA_SCHEMA, errors=errors
|
step_id="user", data_schema=DATA_SCHEMA, errors=errors
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class InvalidSensorsData(exceptions.HomeAssistantError):
|
|
||||||
"""Error to indicate invalid sensors data."""
|
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/gios",
|
"documentation": "https://www.home-assistant.io/integrations/gios",
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": ["@bieniu"],
|
"codeowners": ["@bieniu"],
|
||||||
"requirements": ["gios==0.0.5"],
|
"requirements": ["gios==0.1.1"],
|
||||||
"config_flow": true
|
"config_flow": true
|
||||||
}
|
}
|
||||||
|
@ -611,7 +611,7 @@ georss_qld_bushfire_alert_client==0.3
|
|||||||
getmac==0.8.1
|
getmac==0.8.1
|
||||||
|
|
||||||
# homeassistant.components.gios
|
# homeassistant.components.gios
|
||||||
gios==0.0.5
|
gios==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.gitter
|
# homeassistant.components.gitter
|
||||||
gitterpy==0.1.7
|
gitterpy==0.1.7
|
||||||
|
@ -243,7 +243,7 @@ georss_qld_bushfire_alert_client==0.3
|
|||||||
getmac==0.8.1
|
getmac==0.8.1
|
||||||
|
|
||||||
# homeassistant.components.gios
|
# homeassistant.components.gios
|
||||||
gios==0.0.5
|
gios==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.glances
|
# homeassistant.components.glances
|
||||||
glances_api==0.2.0
|
glances_api==0.2.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user