From 027266ed8b3a02572d52d14f52d57ab0c9933870 Mon Sep 17 00:00:00 2001 From: Daniel Zozin Date: Mon, 18 Jul 2016 00:18:16 +0200 Subject: [PATCH] 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) --- homeassistant/components/switch/rpi_gpio.py | 1 + 1 file changed, 1 insertion(+) diff --git a/homeassistant/components/switch/rpi_gpio.py b/homeassistant/components/switch/rpi_gpio.py index 5daa96397dc..23a98a3f7ba 100644 --- a/homeassistant/components/switch/rpi_gpio.py +++ b/homeassistant/components/switch/rpi_gpio.py @@ -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):