From 6ef60c094a914f8398d3761fbeaf69f43691b215 Mon Sep 17 00:00:00 2001 From: Tobias Boesch Date: Sat, 18 Mar 2023 09:40:20 +0100 Subject: [PATCH] Aborting shutdown sequence now checks for StatusLED configuration * Code not working * Base for discussion --- components/gpio_control/GPIODevices/shutdown_button.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/gpio_control/GPIODevices/shutdown_button.py b/components/gpio_control/GPIODevices/shutdown_button.py index ee8cb1e98..839efbe8c 100644 --- a/components/gpio_control/GPIODevices/shutdown_button.py +++ b/components/gpio_control/GPIODevices/shutdown_button.py @@ -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) + # switch off LED if pressing was cancelled early (during flashing) and no status led is configured + if status_led is not CONFUGRED: + self.set_led(GPIO.LOW) + else: + self.set_led(GPIO.HIGH) + def __repr__(self): return ''.format(