From 9e5e4c2a7014bd584e9ab1d9d17b354550d34a9f Mon Sep 17 00:00:00 2001 From: Etienne Chassaing <60154720+cetiennec@users.noreply.github.com> Date: Mon, 4 Aug 2025 15:58:25 +0200 Subject: [PATCH] corrected active_PUs logic --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index dc3160d..489832e 100644 --- a/main.py +++ b/main.py @@ -225,7 +225,7 @@ def get_pu_status(): } logging.info(f"[PU STATUS] {states}") - active_PUs = [pu for pu, status in states.items() if status != 'OFF'] + active_PUs = [index + 1 for index, (pu, status) in enumerate(states.items()) if status != 'Offline'] logging.info(f"[ACTIVE PU] {active_PUs}") return JSONResponse(content=states)