1 """The air-Q integration."""
3 from __future__
import annotations
9 from .const
import CONF_CLIP_NEGATIVE, CONF_RETURN_AVERAGE
10 from .coordinator
import AirQCoordinator
12 PLATFORMS: list[Platform] = [Platform.SENSOR]
14 AirQConfigEntry = ConfigEntry[AirQCoordinator]
18 """Set up air-Q from a config entry."""
23 clip_negative=entry.options.get(CONF_CLIP_NEGATIVE,
True),
24 return_average=entry.options.get(CONF_RETURN_AVERAGE,
True),
28 await coordinator.async_config_entry_first_refresh()
30 entry.runtime_data = coordinator
32 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
33 entry.async_on_unload(entry.add_update_listener(update_listener))
39 """Unload a config entry."""
40 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
44 """Handle options update."""
45 await hass.config_entries.async_reload(entry.entry_id)
None update_listener(HomeAssistant hass, ConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, AirQConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, AirQConfigEntry entry)