Correct switch verify to handle discret_read in Modbus (#66890)
This commit is contained in:
parent
8080aab98e
commit
0f580af1d3
1 changed files with 1 additions and 1 deletions
|
@ -312,7 +312,7 @@ class BaseSwitch(BasePlatform, ToggleEntity, RestoreEntity):
|
||||||
|
|
||||||
self._lazy_errors = self._lazy_error_count
|
self._lazy_errors = self._lazy_error_count
|
||||||
self._attr_available = True
|
self._attr_available = True
|
||||||
if self._verify_type == CALL_TYPE_COIL:
|
if self._verify_type in (CALL_TYPE_COIL, CALL_TYPE_DISCRETE):
|
||||||
self._attr_is_on = bool(result.bits[0] & 1)
|
self._attr_is_on = bool(result.bits[0] & 1)
|
||||||
else:
|
else:
|
||||||
value = int(result.registers[0])
|
value = int(result.registers[0])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue