Skip to content

Commit

Permalink
Aborting shutdown sequence now checks for StatusLED configuration
Browse files Browse the repository at this point in the history
* Code not working
* Base for discussion
  • Loading branch information
topas-rec committed Mar 18, 2023
1 parent 3901c69 commit b63b715
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/gpio_control/GPIODevices/shutdown_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ def callbackFunctionHandler(self, *args):
# leave it on for the moment, it will be off when the system is down
self.when_pressed(*args)
else:
# switch off LED if pressing was cancelled early (during flashing)
self.set_led(GPIO.LOW)
# leave LED on if pressing was cancelled early (during flashing) and status led uses the same pin as shutdown led
if status_led.GPIO and (status_led.GPIO is self.led_pin):
self.set_led(GPIO.HIGH)
else:
self.set_led(GPIO.LOW)


def __repr__(self):
return '<ShutdownButton-{}(pin={},hold_time={},iteration_time={},led_pin={},edge={},bouncetime={},antibouncehack={},pull_up_down={})>'.format(
Expand Down

0 comments on commit b63b715

Please sign in to comment.