mirror of
https://github.com/home-assistant/core.git
synced 2026-07-05 05:35:29 +01:00
bde3b6e59f
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
27 lines
945 B
Python
27 lines
945 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.BUTTON, Platform.FAN, Platform.SENSOR]
|
|
|
|
|
|
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)
|