Add test coverage for WiZ lights and switches (#66387)

This commit is contained in:
J. Nick Koston 2022-02-14 09:31:26 -06:00 committed by GitHub
parent 4522a5698c
commit 445ad1d592
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 288 additions and 43 deletions

View file

@ -17,17 +17,11 @@ _LOGGER = logging.getLogger(__name__)
async def async_discover_devices(
hass: HomeAssistant, timeout: int, address: str | None = None
hass: HomeAssistant, timeout: int
) -> list[DiscoveredBulb]:
"""Discover wiz devices."""
if address:
targets = [address]
else:
targets = [
str(address)
for address in await network.async_get_ipv4_broadcast_addresses(hass)
]
broadcast_addrs = await network.async_get_ipv4_broadcast_addresses(hass)
targets = [str(address) for address in broadcast_addrs]
combined_discoveries: dict[str, DiscoveredBulb] = {}
for idx, discovered in enumerate(
await asyncio.gather(