1 """The GIOS component."""
3 from __future__
import annotations
8 from aiohttp
import ClientSession
9 from aiohttp.client_exceptions
import ClientConnectorError
11 from gios.exceptions
import GiosError
12 from gios.model
import GiosSensors
17 from .const
import API_TIMEOUT, DOMAIN, SCAN_INTERVAL
19 _LOGGER = logging.getLogger(__name__)
23 """Define an object to hold GIOS data."""
26 self, hass: HomeAssistant, session: ClientSession, station_id: int
28 """Class to manage fetching GIOS data API."""
29 self.
giosgios = Gios(station_id, session)
31 super().
__init__(hass, _LOGGER, name=DOMAIN, update_interval=SCAN_INTERVAL)
34 """Update data via library."""
36 async
with asyncio.timeout(API_TIMEOUT):
38 except (GiosError, ClientConnectorError)
as error:
GiosSensors _async_update_data(self)
None __init__(self, HomeAssistant hass, ClientSession session, int station_id)