Home Assistant Unofficial Reference 2024.12.1
config_flow.py
Go to the documentation of this file.
1 """Config flow for Hisense AEH-W4A1 integration."""
2 
3 from pyaehw4a1.aehw4a1 import AehW4a1
4 
5 from homeassistant.core import HomeAssistant
6 from homeassistant.helpers import config_entry_flow
7 
8 from .const import DOMAIN
9 
10 
11 async def _async_has_devices(hass: HomeAssistant) -> bool:
12  """Return if there are devices that can be discovered."""
13  aehw4a1_ip_addresses = await AehW4a1().discovery()
14  return len(aehw4a1_ip_addresses) > 0
15 
16 
17 config_entry_flow.register_discovery_flow(
18  DOMAIN, "Hisense AEH-W4A1", _async_has_devices
19 )