From 1c25255d9c6880469045704b009bbbbdfc855693 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Thu, 5 Dec 2024 13:01:03 +0100 Subject: [PATCH] adjusted get_running_detectors to running, limping, missing reponse --- slic/core/acquisition/broker/restapi.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/slic/core/acquisition/broker/restapi.py b/slic/core/acquisition/broker/restapi.py index 7fe3f1ec..a51b7353 100644 --- a/slic/core/acquisition/broker/restapi.py +++ b/slic/core/acquisition/broker/restapi.py @@ -50,7 +50,16 @@ def power_on_detector(address, detector, *args, **kwargs): def get_running_detectors(address, *args, **kwargs): params = {} response = get_request(address, "get_running_detectors", params, *args, **kwargs) - return response.get("detectors") + target_keys = ( + "missing_detectors", + "running_detectors", + "limping_detectors" + ) + res = {k: response[k] for k in target_keys & response.keys()} + if res: + return res + else: + return response.get("detectors") #TODO: remove, kept for backwards compatibility def get_allowed_detectors(address, *args, **kwargs): params = {}