From 6b3b000822dd5306da590bed173ab4364c9a958e Mon Sep 17 00:00:00 2001 From: sfam Date: Wed, 26 Aug 2015 11:22:06 +0100 Subject: [PATCH] quick fix --- homeassistant/components/switch/rpi_gpio.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/switch/rpi_gpio.py b/homeassistant/components/switch/rpi_gpio.py index 298168ed65a..c21280a2fa8 100644 --- a/homeassistant/components/switch/rpi_gpio.py +++ b/homeassistant/components/switch/rpi_gpio.py @@ -74,8 +74,8 @@ class RPiGPIOSwitch(ToggleEntity): def __init__(self, name, gpio, invert_logic): self._name = name or DEVICE_DEFAULT_NAME self._gpio = gpio - self._active_state = !invert_logic - self._state = !self._active_state + self._active_state = not invert_logic + self._state = not self._active_state # pylint: disable=no-member GPIO.setup(gpio, GPIO.OUT) @@ -102,7 +102,7 @@ class RPiGPIOSwitch(ToggleEntity): def turn_off(self, **kwargs): """ Turn the device off. """ - if self._switch(!self._active_state): + if self._switch(not self._active_state): self._state = False self.update_ha_state()