1 """The PEGELONLINE component."""
3 from __future__
import annotations
7 from aiopegelonline
import PegelOnline
14 from .const
import CONF_STATION
15 from .coordinator
import PegelOnlineDataUpdateCoordinator
17 _LOGGER = logging.getLogger(__name__)
19 PLATFORMS = [Platform.SENSOR]
21 type PegelOnlineConfigEntry = ConfigEntry[PegelOnlineDataUpdateCoordinator]
25 """Set up PEGELONLINE entry."""
26 station_uuid = entry.data[CONF_STATION]
28 _LOGGER.debug(
"Setting up station with uuid %s", station_uuid)
31 station = await api.async_get_station_details(station_uuid)
35 await coordinator.async_config_entry_first_refresh()
37 entry.runtime_data = coordinator
39 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
45 """Unload PEGELONLINE entry."""
46 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_setup_entry(HomeAssistant hass, PegelOnlineConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
aiohttp.ClientSession async_get_clientsession(HomeAssistant hass, bool verify_ssl=True, socket.AddressFamily family=socket.AF_UNSPEC, ssl_util.SSLCipherList ssl_cipher=ssl_util.SSLCipherList.PYTHON_DEFAULT)