Skip to content

Commit 00a51fd

Browse files
committed
Set the led state for shutdown cancellation in ShutdownButton and use this value
1 parent 0152b42 commit 00a51fd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

components/gpio_control/GPIODevices/shutdown_button.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@ 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-
# 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)
57+
# switch off LED if pressing was cancelled early (during flashing)
58+
self.set_led(self.led_state_shutdown_cancelled)
6259

6360

6461
def __repr__(self):

components/gpio_control/gpio_control.py

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ def gpio_loop(self):
125125
gpio_controler = gpio_control(phoniebox_function_calls)
126126

127127
devices = gpio_controler.get_all_devices(config)
128+
# Sets the led value at the shutdown button that should be used in case of the shutdown
129+
# sequence is cancelled if StatusLED and ShutdownLED use the sampe GPIO
128130
gpio_controler.checkDevicesDependencies()
129131
gpio_controler.print_all_devices()
130132
gpio_controler.gpio_loop()

0 commit comments

Comments
 (0)