Define __init__ before other methods in Modbus (#187557)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Joost Lekkerkerker
2026-10-20 19:00:37 +02:00
committed by GitHub
co-authored by Claude
parent 2e511f12bd
commit c736c2f420
+6 -6
View File
@@ -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."""