mirror of
https://github.com/home-assistant/core.git
synced 2026-07-01 03:36:05 +01:00
27 lines
911 B
Python
27 lines
911 B
Python
"""The Helty Flow integration."""
|
|
|
|
from pyhelty import HeltyClient
|
|
|
|
from homeassistant.const import CONF_HOST, Platform
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .coordinator import HeltyConfigEntry, HeltyDataUpdateCoordinator
|
|
|
|
PLATFORMS: list[Platform] = [Platform.FAN]
|
|
|
|
|
|
async def async_setup_entry(hass: HomeAssistant, entry: HeltyConfigEntry) -> bool:
|
|
"""Set up Helty Flow from a config entry."""
|
|
client = HeltyClient(entry.data[CONF_HOST])
|
|
coordinator = HeltyDataUpdateCoordinator(hass, entry, client)
|
|
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: HeltyConfigEntry) -> bool:
|
|
"""Unload a config entry."""
|
|
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|