From 4ed2efa4e8f2cf9ba4a4871f5d149baf80d96f69 Mon Sep 17 00:00:00 2001 From: David Rapan Date: Mon, 24 Nov 2025 22:24:24 +0100 Subject: [PATCH] Remove Shelly switch name removal (#157072) Signed-off-by: David Rapan Co-authored-by: Shay Levy --- homeassistant/components/shelly/switch.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/homeassistant/components/shelly/switch.py b/homeassistant/components/shelly/switch.py index 99d821c07e0..633c05ffc2f 100644 --- a/homeassistant/components/shelly/switch.py +++ b/homeassistant/components/shelly/switch.py @@ -425,9 +425,6 @@ class BlockSleepingMotionSwitch( super().__init__(coordinator, block, attribute, description, entry) self.last_state: State | None = None - if hasattr(self, "_attr_name"): - delattr(self, "_attr_name") - @property def is_on(self) -> bool | None: """If motion is active.""" @@ -514,10 +511,8 @@ class RpcSwitch(ShellyRpcAttributeEntity, SwitchEntity): """Initialize select.""" super().__init__(coordinator, key, attribute, description) - if description.role == ROLE_GENERIC or description.key in ("switch", "script"): + if description.key in ("switch", "script"): self._attr_name = get_rpc_channel_name(coordinator.device, key) - elif hasattr(self, "_attr_name"): - delattr(self, "_attr_name") @property def is_on(self) -> bool: