Switcher - use single_config_entry and register_discovery_flow in con… (#118000)

This commit is contained in:
Shay Levy 2024-05-24 10:15:17 +03:00 committed by GitHub
parent ad90ecef3f
commit cb59eb183d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 48 additions and 94 deletions

View file

@ -36,7 +36,7 @@ async def async_stop_bridge(hass: HomeAssistant) -> None:
hass.data[DOMAIN].pop(DATA_BRIDGE)
async def async_discover_devices() -> dict[str, SwitcherBase]:
async def async_has_devices(hass: HomeAssistant) -> bool:
"""Discover Switcher devices."""
_LOGGER.debug("Starting discovery")
discovered_devices = {}
@ -55,7 +55,7 @@ async def async_discover_devices() -> dict[str, SwitcherBase]:
await bridge.stop()
_LOGGER.debug("Finished discovery, discovered devices: %s", len(discovered_devices))
return discovered_devices
return len(discovered_devices) > 0
@singleton.singleton("switcher_breeze_remote_manager")