mirror of
https://github.com/home-assistant/core
synced 2024-07-27 18:58:57 +02:00
Correct switch verify to handle discret_read in Modbus (#66890)
This commit is contained in:
parent
8080aab98e
commit
0f580af1d3
@ -312,7 +312,7 @@ class BaseSwitch(BasePlatform, ToggleEntity, RestoreEntity):
|
||||
|
||||
self._lazy_errors = self._lazy_error_count
|
||||
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)
|
||||
else:
|
||||
value = int(result.registers[0])
|
||||
|
Loading…
Reference in New Issue
Block a user