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
2 changed files with 2 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue