From 11357b9a0eb2adec41b11086d9dfdf00232e84ec Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Thu, 6 Aug 2026 15:19:30 +0200 Subject: [PATCH] DEBUG led somtimes don't update --- micro_ondes/esp_wifi/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/micro_ondes/esp_wifi/main.py b/micro_ondes/esp_wifi/main.py index ee0ef10..c202d42 100644 --- a/micro_ondes/esp_wifi/main.py +++ b/micro_ondes/esp_wifi/main.py @@ -80,20 +80,27 @@ def on_cooking_state_change(state): """Callback executed whenever local cooking state transitions.""" BLINK_INTERVAL_MS = 500 + log(f"[CookingState] State changed to: {state.state}") + if status_led and cookingState: if state.state == cookingState.CookingStates.IDLE: + log(f"[CookingState] State changed to IDLE. Turning LED off and stopping blink.") status_led.color = status_led.OFF status_led.blink_off() elif state.state == cookingState.CookingStates.COOKING: + log(f"[CookingState] State changed to COOKING. Turning LED yellow and stopping blink.") status_led.color = status_led.YELLOW status_led.blink_off() elif state.state == cookingState.CookingStates.STIRRING_REQUIRED: + log(f"[CookingState] State changed to STIRRING_REQUIRED. Turning LED orange and starting blink.") status_led.color = status_led.ORANGE status_led.blink_on(BLINK_INTERVAL_MS) elif state.state == cookingState.CookingStates.ALERT: + log(f"[CookingState] State changed to ALERT. Turning LED red and starting blink.") status_led.color = status_led.RED status_led.blink_on(BLINK_INTERVAL_MS) elif state.state == cookingState.CookingStates.DONE: + log(f"[CookingState] State changed to DONE. Turning LED green and stopping blink.") status_led.color = status_led.GREEN status_led.blink_off()