Skip to content

Commit

Permalink
change default value for force switch
Browse files Browse the repository at this point in the history
  • Loading branch information
enra64 committed Jul 20, 2021
1 parent 5c4735c commit 06f6157
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions host/scripts/_WakeUpLight/_WakeUpLight.py
Expand Up @@ -18,11 +18,8 @@ def __init__(self, canvas, send_object, send_object_to_all, start_script, restar
set_frame_rate, get_connected_clients)
# setup
self.logger = logging.getLogger("script:wakeuplight")
try:
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP)
except:
self.logger.warning("Couldn't setup force pin 17")
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP)
self.set_frame_rate(5)
self._was_forced = False
self._clear_properties()
Expand All @@ -44,10 +41,7 @@ def update(self, canvas):
self.current_color = Color.from_temperature(self.test_color_temperature, 1)
return

try:
force_switch = GPIO.input(17) == GPIO.HIGH
except:
force_switch = False
force_switch = GPIO.input(17) == GPIO.LOW
# self.logger.debug("Wakeuplight force-on is {}".format(force_switch))
if force_switch:
self.current_color = Color.from_temperature(3000, .75)
Expand Down

0 comments on commit 06f6157

Please sign in to comment.