Remove Shelly switch name removal (#157072)

Signed-off-by: David Rapan <david@rapan.cz>
Co-authored-by: Shay Levy <levyshay1@gmail.com>
This commit is contained in:
David Rapan
2025-11-24 22:24:24 +01:00
committed by GitHub
parent abef6f7b3e
commit 4ed2efa4e8

View File

@@ -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: