1 """The APsystems local API integration."""
3 from __future__
import annotations
5 from dataclasses
import dataclass
7 from APsystemsEZ1
import APsystemsEZ1M
13 from .const
import DEFAULT_PORT
14 from .coordinator
import ApSystemsDataCoordinator
16 PLATFORMS: list[Platform] = [
17 Platform.BINARY_SENSOR,
26 """Store runtime data."""
28 coordinator: ApSystemsDataCoordinator
32 type ApSystemsConfigEntry = ConfigEntry[ApSystemsData]
36 """Set up this integration using UI."""
38 ip_address=entry.data[CONF_IP_ADDRESS],
39 port=entry.data.get(CONF_PORT, DEFAULT_PORT),
44 await coordinator.async_config_entry_first_refresh()
45 assert entry.unique_id
47 coordinator=coordinator, device_id=entry.unique_id
49 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
55 """Unload a config entry."""
56 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_setup_entry(HomeAssistant hass, ApSystemsConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)