mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00: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._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…
x
Reference in New Issue
Block a user