Skip to content

Commit 4ed2efa

Browse files
davidrapanthecode
andauthored
Remove Shelly switch name removal (home-assistant#157072)
Signed-off-by: David Rapan <[email protected]> Co-authored-by: Shay Levy <[email protected]>
1 parent abef6f7 commit 4ed2efa

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

homeassistant/components/shelly/switch.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,6 @@ def __init__(
425425
super().__init__(coordinator, block, attribute, description, entry)
426426
self.last_state: State | None = None
427427

428-
if hasattr(self, "_attr_name"):
429-
delattr(self, "_attr_name")
430-
431428
@property
432429
def is_on(self) -> bool | None:
433430
"""If motion is active."""
@@ -514,10 +511,8 @@ def __init__(
514511
"""Initialize select."""
515512
super().__init__(coordinator, key, attribute, description)
516513

517-
if description.role == ROLE_GENERIC or description.key in ("switch", "script"):
514+
if description.key in ("switch", "script"):
518515
self._attr_name = get_rpc_channel_name(coordinator.device, key)
519-
elif hasattr(self, "_attr_name"):
520-
delattr(self, "_attr_name")
521516

522517
@property
523518
def is_on(self) -> bool:

0 commit comments

Comments
 (0)