1 """The World Air Quality Index (WAQI) integration."""
3 from __future__
import annotations
5 from aiowaqi
import WAQIClient
12 from .const
import DOMAIN
13 from .coordinator
import WAQIDataUpdateCoordinator
15 PLATFORMS: list[Platform] = [Platform.SENSOR]
19 """Set up World Air Quality Index (WAQI) from a config entry."""
22 client.authenticate(entry.data[CONF_API_KEY])
25 await waqi_coordinator.async_config_entry_first_refresh()
26 hass.data.setdefault(DOMAIN, {})[entry.entry_id] = waqi_coordinator
28 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
34 """Unload a config entry."""
35 if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
36 hass.data[DOMAIN].pop(entry.entry_id)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, ConfigEntry 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)