-
-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Expand file tree
/
Copy path__init__.py
More file actions
32 lines (19 loc) · 884 Bytes
/
__init__.py
File metadata and controls
32 lines (19 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""The Kiosker integration."""
from __future__ import annotations
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from .coordinator import KioskerConfigEntry, KioskerDataUpdateCoordinator
_PLATFORMS: list[Platform] = [Platform.SENSOR]
async def async_setup_entry(hass: HomeAssistant, entry: KioskerConfigEntry) -> bool:
"""Set up Kiosker from a config entry."""
coordinator = KioskerDataUpdateCoordinator(
hass,
entry,
)
await coordinator.async_config_entry_first_refresh()
entry.runtime_data = coordinator
await hass.config_entries.async_forward_entry_setups(entry, _PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: KioskerConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(entry, _PLATFORMS)