1 """The aurora component."""
7 from .const
import CONF_THRESHOLD, DEFAULT_THRESHOLD
8 from .coordinator
import AuroraDataUpdateCoordinator
10 PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR]
12 type AuroraConfigEntry = ConfigEntry[AuroraDataUpdateCoordinator]
16 """Set up Aurora from a config entry."""
19 await coordinator.async_config_entry_first_refresh()
21 entry.runtime_data = coordinator
23 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
25 entry.async_on_unload(entry.add_update_listener(update_listener))
30 """Handle options update."""
31 entry.runtime_data.threshold =
int(
32 entry.options.get(CONF_THRESHOLD, DEFAULT_THRESHOLD)
35 await entry.runtime_data.async_request_refresh()
39 """Unload a config entry."""
40 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_setup_entry(HomeAssistant hass, AuroraConfigEntry entry)
None update_listener(HomeAssistant hass, AuroraConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, AuroraConfigEntry entry)