Skip to content

Commit b63b715

Browse files
committed
Aborting shutdown sequence now checks for StatusLED configuration
* Code not working * Base for discussion
1 parent 3901c69 commit b63b715

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

components/gpio_control/GPIODevices/shutdown_button.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ def callbackFunctionHandler(self, *args):
5454
# leave it on for the moment, it will be off when the system is down
5555
self.when_pressed(*args)
5656
else:
57-
# switch off LED if pressing was cancelled early (during flashing)
58-
self.set_led(GPIO.LOW)
57+
# leave LED on if pressing was cancelled early (during flashing) and status led uses the same pin as shutdown led
58+
if status_led.GPIO and (status_led.GPIO is self.led_pin):
59+
self.set_led(GPIO.HIGH)
60+
else:
61+
self.set_led(GPIO.LOW)
62+
5963

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

0 commit comments

Comments
 (0)