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)
This commit is contained in:
parent
ddcad275f7
commit
027266ed8b
1 changed files with 1 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue