__init__.py (933B)
1 """Home Assistant integration for Hunter BTT Bluetooth irrigation valves.""" 2 3 from homeassistant.const import Platform 4 from homeassistant.core import HomeAssistant 5 6 from .coordinator import HunterBTTConfigEntry, HunterBTTCoordinator 7 8 PLATFORMS: list[Platform] = [ 9 Platform.BINARY_SENSOR, 10 Platform.SENSOR, 11 Platform.NUMBER, 12 Platform.VALVE, 13 ] 14 15 16 async def async_setup_entry(hass: HomeAssistant, entry: HunterBTTConfigEntry) -> bool: 17 """Set up Hunter BTT from a config entry.""" 18 coordinator = HunterBTTCoordinator(hass, entry) 19 await coordinator.async_config_entry_first_refresh() 20 21 entry.runtime_data = coordinator 22 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) 23 return True 24 25 26 async def async_unload_entry(hass: HomeAssistant, entry: HunterBTTConfigEntry) -> bool: 27 """Unload a config entry.""" 28 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)