1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-05 05:35:29 +01:00
Files
core/homeassistant/components/starlink/__init__.py
T
2026-04-30 21:14:48 +02:00

34 lines
964 B
Python

"""The Starlink integration."""
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from .coordinator import StarlinkConfigEntry, StarlinkUpdateCoordinator
PLATFORMS = [
Platform.BINARY_SENSOR,
Platform.BUTTON,
Platform.DEVICE_TRACKER,
Platform.SENSOR,
Platform.SWITCH,
Platform.TIME,
]
async def async_setup_entry(
hass: HomeAssistant, config_entry: StarlinkConfigEntry
) -> bool:
"""Set up Starlink from a config entry."""
config_entry.runtime_data = StarlinkUpdateCoordinator(hass, config_entry)
await config_entry.runtime_data.async_config_entry_first_refresh()
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
return True
async def async_unload_entry(
hass: HomeAssistant, config_entry: StarlinkConfigEntry
) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)