Fix bool registers in modbus integration (#41506)

When a register is of type bool modbus returns a whole byte, but ONLY the
lowest bit determine true/false.
This commit is contained in:
jan iversen authored and GitHub committed 2020-10-08 23:52:41 +02:00
1 parent 8e3258cdfb
commit 4d9ff13384
5 files changed
+52 -33

No files matched your search

@@ -122,5 +122,5 @@ class ModbusBinarySensor(BinarySensorEntity):
self._available = False
return
self._value = result.bits[0]
self._value = result.bits[0] & 1
self._available = True