Refactor hardware.async_info to return list[HardwareInfo] (#77183)

This commit is contained in:
Erik Montnemery 2022-08-29 08:45:39 +02:00 committed by GitHub
parent 0154a1cecb
commit 067d21a307
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 81 additions and 74 deletions

View file

@ -42,6 +42,6 @@ async def ws_info(
for platform in hardware_platform.values():
if hasattr(platform, "async_info"):
with contextlib.suppress(HomeAssistantError):
hardware_info.append(asdict(platform.async_info(hass)))
hardware_info.extend([asdict(hw) for hw in platform.async_info(hass)])
connection.send_result(msg["id"], {"hardware": hardware_info})