1 """The PoolSense integration."""
5 from poolsense
import PoolSense
12 from .coordinator
import PoolSenseDataUpdateCoordinator
14 type PoolSenseConfigEntry = ConfigEntry[PoolSenseDataUpdateCoordinator]
16 PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR]
19 _LOGGER = logging.getLogger(__name__)
23 """Set up PoolSense from a config entry."""
25 poolsense = PoolSense(
26 aiohttp_client.async_get_clientsession(hass),
27 entry.data[CONF_EMAIL],
28 entry.data[CONF_PASSWORD],
30 auth_valid = await poolsense.test_poolsense_credentials()
33 _LOGGER.error(
"Invalid authentication")
38 await coordinator.async_config_entry_first_refresh()
40 entry.runtime_data = coordinator
42 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
48 """Unload a config entry."""
49 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, PoolSenseConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, PoolSenseConfigEntry entry)