1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-30 04:05:01 +01:00
Files
2026-04-30 21:14:48 +02:00

34 lines
1.0 KiB
Python

"""The iss component."""
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from .coordinator import IssConfigEntry, IssDataUpdateCoordinator
PLATFORMS = [Platform.SENSOR]
async def async_setup_entry(hass: HomeAssistant, entry: IssConfigEntry) -> bool:
"""Set up this integration using UI."""
coordinator = IssDataUpdateCoordinator(hass, entry)
await coordinator.async_config_entry_first_refresh()
entry.runtime_data = coordinator
entry.async_on_unload(entry.add_update_listener(update_listener))
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: IssConfigEntry) -> bool:
"""Handle removal of an entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
async def update_listener(hass: HomeAssistant, entry: IssConfigEntry) -> None:
"""Handle options update."""
await hass.config_entries.async_reload(entry.entry_id)