mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Reset Modbus value on down (#86127)
* modbus: slave should reset value on sensor down as parent does that * modbus: slave should reset value on sensor down as parent does that
This commit is contained in:
parent
0b45fb6dc3
commit
9d9817328b
@ -153,6 +153,5 @@ class SlaveSensor(
|
|||||||
def _handle_coordinator_update(self) -> None:
|
def _handle_coordinator_update(self) -> None:
|
||||||
"""Handle updated data from the coordinator."""
|
"""Handle updated data from the coordinator."""
|
||||||
result = self.coordinator.data
|
result = self.coordinator.data
|
||||||
if result:
|
self._attr_is_on = bool(result[self._result_inx] & 1) if result else None
|
||||||
self._attr_is_on = bool(result[self._result_inx] & 1)
|
|
||||||
super()._handle_coordinator_update()
|
super()._handle_coordinator_update()
|
||||||
|
@ -156,6 +156,5 @@ class SlaveSensor(
|
|||||||
def _handle_coordinator_update(self) -> None:
|
def _handle_coordinator_update(self) -> None:
|
||||||
"""Handle updated data from the coordinator."""
|
"""Handle updated data from the coordinator."""
|
||||||
result = self.coordinator.data
|
result = self.coordinator.data
|
||||||
if result:
|
self._attr_native_value = result[self._idx] if result else None
|
||||||
self._attr_native_value = result[self._idx]
|
|
||||||
super()._handle_coordinator_update()
|
super()._handle_coordinator_update()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user