1 """Support for APCUPSd via its Network Information Server (NIS)."""
3 from __future__
import annotations
5 from typing
import Final
11 from .coordinator
import APCUPSdCoordinator
13 type APCUPSdConfigEntry = ConfigEntry[APCUPSdCoordinator]
15 PLATFORMS: Final = (Platform.BINARY_SENSOR, Platform.SENSOR)
19 hass: HomeAssistant, config_entry: APCUPSdConfigEntry
21 """Use config values to set up a function enabling status retrieval."""
22 host, port = config_entry.data[CONF_HOST], config_entry.data[CONF_PORT]
25 await coordinator.async_config_entry_first_refresh()
28 config_entry.runtime_data = coordinator
31 await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
36 """Unload a config entry."""
37 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, APCUPSdConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, APCUPSdConfigEntry config_entry)