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:
Daniel Zozin authored and Paulus Schoutsen committed 2016-07-17 15:18:16 -07:00
1 parent ddcad275f7
commit 027266ed8b
1 file changed
+1
@@ -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):