Fix initialization state for GPIO switches configured with inverted logic (#2550)
When switches are configured to use inverted logic, the GPIO pins initial state has to be inverted as well (set to HIGH)pull/2558/head
parent
ddcad275f7
commit
027266ed8b
|
@ -39,6 +39,7 @@ class RPiGPIOSwitch(ToggleEntity):
|
|||
self._invert_logic = invert_logic
|
||||
self._state = False
|
||||
rpi_gpio.setup_output(self._port)
|
||||
rpi_gpio.write_output(self._port, 1 if self._invert_logic else 0)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
|
Loading…
Reference in New Issue