mirror of
https://github.com/home-assistant/core.git
synced 2026-12-04 12:50:45 -04:00
Define __init__ before other methods in Modbus (#187557)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
2e511f12bd
commit
c736c2f420
@@ -163,12 +163,6 @@ class SlaveSensor(
|
||||
):
|
||||
"""Modbus slave register sensor."""
|
||||
|
||||
@property
|
||||
@override
|
||||
def available(self) -> bool:
|
||||
"""Return True if entity is available."""
|
||||
return self._attr_available
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
coordinator: DataUpdateCoordinator[list[float | None] | None],
|
||||
@@ -188,6 +182,12 @@ class SlaveSensor(
|
||||
self._attr_available = False
|
||||
super().__init__(coordinator)
|
||||
|
||||
@property
|
||||
@override
|
||||
def available(self) -> bool:
|
||||
"""Return True if entity is available."""
|
||||
return self._attr_available
|
||||
|
||||
@override
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Handle entity which will be added."""
|
||||
|
||||
Reference in New Issue
Block a user