|
23 | 23 | from homeassistant.core import HomeAssistant, callback |
24 | 24 | from homeassistant.exceptions import HomeAssistantError |
25 | 25 | from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback |
26 | | -from homeassistant.helpers.entity_registry import RegistryEntry |
27 | 26 | from homeassistant.helpers.restore_state import RestoreEntity |
28 | 27 |
|
29 | 28 | from .const import ( |
@@ -182,9 +181,6 @@ def __init__( |
182 | 181 | ) |
183 | 182 | self._in_progress_old_version: str | None = None |
184 | 183 |
|
185 | | - if hasattr(self, "_attr_name"): |
186 | | - delattr(self, "_attr_name") |
187 | | - |
188 | 184 | @property |
189 | 185 | def installed_version(self) -> str | None: |
190 | 186 | """Version currently in use.""" |
@@ -278,9 +274,6 @@ def __init__( |
278 | 274 | coordinator.device.gen, coordinator.model, description.beta |
279 | 275 | ) |
280 | 276 |
|
281 | | - if hasattr(self, "_attr_name"): |
282 | | - delattr(self, "_attr_name") |
283 | | - |
284 | 277 | async def async_added_to_hass(self) -> None: |
285 | 278 | """When entity is added to hass.""" |
286 | 279 | await super().async_added_to_hass() |
@@ -376,20 +369,6 @@ class RpcSleepingUpdateEntity( |
376 | 369 |
|
377 | 370 | entity_description: RpcUpdateDescription |
378 | 371 |
|
379 | | - def __init__( |
380 | | - self, |
381 | | - coordinator: ShellyRpcCoordinator, |
382 | | - key: str, |
383 | | - attribute: str, |
384 | | - description: RpcUpdateDescription, |
385 | | - entry: RegistryEntry | None = None, |
386 | | - ) -> None: |
387 | | - """Initialize the sleeping sensor.""" |
388 | | - super().__init__(coordinator, key, attribute, description, entry) |
389 | | - |
390 | | - if hasattr(self, "_attr_name"): |
391 | | - delattr(self, "_attr_name") |
392 | | - |
393 | 372 | async def async_added_to_hass(self) -> None: |
394 | 373 | """Handle entity which will be added.""" |
395 | 374 | await super().async_added_to_hass() |
|
0 commit comments