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:
parent
8e3258cdfb
commit
4d9ff13384
5 changed files with 52 additions and 33 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue