From aedd06b9a9257addd6108f98a80598c75f703673 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Wed, 13 Sep 2023 11:14:01 +0200 Subject: [PATCH] Tweak entity/source WS command handler (#100272) --- homeassistant/components/websocket_api/commands.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/websocket_api/commands.py b/homeassistant/components/websocket_api/commands.py index e140fef861e..bd7d3b530cd 100644 --- a/homeassistant/components/websocket_api/commands.py +++ b/homeassistant/components/websocket_api/commands.py @@ -599,10 +599,10 @@ def _serialize_entity_sources( entity_infos: dict[str, entity.EntityInfo] ) -> dict[str, Any]: """Prepare a websocket response from a dict of entity sources.""" - result = {} - for entity_id, entity_info in entity_infos.items(): - result[entity_id] = {"domain": entity_info["domain"]} - return result + return { + entity_id: {"domain": entity_info["domain"]} + for entity_id, entity_info in entity_infos.items() + } @callback