Group sequential async_add_entities calls in Ohme (#187523)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Joost Lekkerkerker
2026-10-20 09:59:28 -04:00
committed by GitHub
co-authored by Claude
parent 925c09a579
commit 85edb7778a
+5 -3
View File
@@ -87,18 +87,20 @@ async def async_setup_entry(
"""Set up switches."""
coordinator = config_entry.runtime_data.device_info_coordinator
async_add_entities(
entities: list[OhmeConfigSwitch | OhmeSwitch] = [
OhmeConfigSwitch(coordinator, description)
for description in SWITCH_CONFIG
if description.is_supported_fn(coordinator.client)
)
]
async_add_entities(
entities.extend(
OhmeSwitch(coordinator, description)
for description in SWITCH_DESCRIPTION
if description.is_supported_fn(coordinator.client)
)
async_add_entities(entities)
class OhmeSwitch(OhmeEntity, SwitchEntity):
"""Generic switch for Ohme."""