1 """The awair component."""
3 from __future__
import annotations
9 from .coordinator
import (
10 AwairCloudDataUpdateCoordinator,
12 AwairDataUpdateCoordinator,
13 AwairLocalDataUpdateCoordinator,
16 PLATFORMS = [Platform.SENSOR]
20 hass: HomeAssistant, config_entry: AwairConfigEntry
22 """Set up Awair integration from a config entry."""
25 coordinator: AwairDataUpdateCoordinator
27 if CONF_HOST
in config_entry.data:
29 config_entry.async_on_unload(
30 config_entry.add_update_listener(_async_update_listener)
35 await coordinator.async_config_entry_first_refresh()
37 config_entry.runtime_data = coordinator
39 await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
45 """Handle options update."""
46 if entry.title != entry.runtime_data.title:
47 await hass.config_entries.async_reload(entry.entry_id)
51 hass: HomeAssistant, config_entry: AwairConfigEntry
53 """Unload Awair configuration."""
54 return await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, AwairConfigEntry config_entry)
bool async_setup_entry(HomeAssistant hass, AwairConfigEntry config_entry)
None _async_update_listener(HomeAssistant hass, AwairConfigEntry entry)
aiohttp.ClientSession async_get_clientsession(HomeAssistant hass, bool verify_ssl=True, socket.AddressFamily family=socket.AF_UNSPEC, ssl_util.SSLCipherList ssl_cipher=ssl_util.SSLCipherList.PYTHON_DEFAULT)