1 """The Airthings BLE integration."""
3 from __future__
import annotations
8 from .const
import MAX_RETRIES_AFTER_STARTUP
9 from .coordinator
import AirthingsBLEConfigEntry, AirthingsBLEDataUpdateCoordinator
11 PLATFORMS: list[Platform] = [Platform.SENSOR]
15 hass: HomeAssistant, entry: AirthingsBLEConfigEntry
17 """Set up Airthings BLE device from a config entry."""
19 await coordinator.async_config_entry_first_refresh()
25 coordinator.airthings.set_max_attempts(MAX_RETRIES_AFTER_STARTUP)
27 entry.runtime_data = coordinator
29 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
35 hass: HomeAssistant, entry: AirthingsBLEConfigEntry
37 """Unload a config entry."""
38 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_unload_entry(HomeAssistant hass, AirthingsBLEConfigEntry entry)
bool async_setup_entry(HomeAssistant hass, AirthingsBLEConfigEntry entry)