Skip to content

Commit af11c7d

Browse files
committed
Set the led state for shutdown cancellation in ShutdownButton and use this value
1 parent 7d4fbc6 commit af11c7d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
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

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

127127
devices = gpio_controler.get_all_devices(config)
128-
gpio_controler.checkDevicesDependencies()
128+
gpio_controler.checkDevicesDependencies() # Sets the led value at the shutdown button that should be used in case of the shutdown sequence is cancelled
129129
gpio_controler.print_all_devices()
130130
gpio_controler.gpio_loop()

0 commit comments

Comments
 (0)