corrected active_PUs logic
This commit is contained in:
parent
6587851267
commit
9e5e4c2a70
2
main.py
2
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user