From 85edb7778a61cfdc2abcfffa1faeab563098468f Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 20 Oct 2026 15:59:28 +0200 Subject: [PATCH] Group sequential async_add_entities calls in Ohme (#187523) Co-authored-by: Claude --- homeassistant/components/ohme/switch.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/ohme/switch.py b/homeassistant/components/ohme/switch.py index 2ae5214ec959..e2d271a99f6d 100644 --- a/homeassistant/components/ohme/switch.py +++ b/homeassistant/components/ohme/switch.py @@ -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."""