mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
quick fix
This commit is contained in:
parent
c8b88219b7
commit
6b3b000822
@ -74,8 +74,8 @@ class RPiGPIOSwitch(ToggleEntity):
|
|||||||
def __init__(self, name, gpio, invert_logic):
|
def __init__(self, name, gpio, invert_logic):
|
||||||
self._name = name or DEVICE_DEFAULT_NAME
|
self._name = name or DEVICE_DEFAULT_NAME
|
||||||
self._gpio = gpio
|
self._gpio = gpio
|
||||||
self._active_state = !invert_logic
|
self._active_state = not invert_logic
|
||||||
self._state = !self._active_state
|
self._state = not self._active_state
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
GPIO.setup(gpio, GPIO.OUT)
|
GPIO.setup(gpio, GPIO.OUT)
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ class RPiGPIOSwitch(ToggleEntity):
|
|||||||
|
|
||||||
def turn_off(self, **kwargs):
|
def turn_off(self, **kwargs):
|
||||||
""" Turn the device off. """
|
""" Turn the device off. """
|
||||||
if self._switch(!self._active_state):
|
if self._switch(not self._active_state):
|
||||||
self._state = False
|
self._state = False
|
||||||
self.update_ha_state()
|
self.update_ha_state()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user