Skip to content

Commit 08baa99

Browse files
davidrapanthecode
andauthored
Remove Shelly button name removal (home-assistant#157066)
Signed-off-by: David Rapan <[email protected]> Co-authored-by: Shay Levy <[email protected]>
1 parent d84cf26 commit 08baa99

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

homeassistant/components/shelly/button.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from homeassistant.exceptions import HomeAssistantError
2222
from homeassistant.helpers import entity_registry as er
2323
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
24-
from homeassistant.helpers.entity_registry import RegistryEntry
2524
from homeassistant.helpers.update_coordinator import CoordinatorEntity
2625

2726
from .const import (
@@ -359,9 +358,6 @@ def __init__(
359358
config, ble_addr, coordinator.mac, fw_ver
360359
)
361360

362-
if hasattr(self, "_attr_name") and description.role != ROLE_GENERIC:
363-
delattr(self, "_attr_name")
364-
365361
@rpc_call
366362
async def async_press(self) -> None:
367363
"""Triggers the Shelly button press service."""
@@ -374,19 +370,6 @@ class RpcVirtualButton(ShellyRpcAttributeEntity, ButtonEntity):
374370
entity_description: RpcButtonDescription
375371
_id: int
376372

377-
def __init__(
378-
self,
379-
coordinator: ShellyRpcCoordinator,
380-
key: str,
381-
attribute: str,
382-
description: RpcButtonDescription,
383-
) -> None:
384-
"""Initialize select."""
385-
super().__init__(coordinator, key, attribute, description)
386-
387-
if hasattr(self, "_attr_name") and description.role != ROLE_GENERIC:
388-
delattr(self, "_attr_name")
389-
390373
@rpc_call
391374
async def async_press(self) -> None:
392375
"""Triggers the Shelly button press service."""
@@ -401,20 +384,6 @@ class RpcSleepingSmokeMuteButton(ShellySleepingRpcAttributeEntity, ButtonEntity)
401384

402385
entity_description: RpcButtonDescription
403386

404-
def __init__(
405-
self,
406-
coordinator: ShellyRpcCoordinator,
407-
key: str,
408-
attribute: str,
409-
description: RpcButtonDescription,
410-
entry: RegistryEntry | None = None,
411-
) -> None:
412-
"""Initialize the sleeping sensor."""
413-
super().__init__(coordinator, key, attribute, description, entry)
414-
415-
if hasattr(self, "_attr_name"):
416-
delattr(self, "_attr_name")
417-
418387
@rpc_call
419388
async def async_press(self) -> None:
420389
"""Triggers the Shelly button press service."""

0 commit comments

Comments
 (0)