From b895534e9b98ec5cae160ffeb6a312e4a7413eec Mon Sep 17 00:00:00 2001 From: Vasileios Bimpikas <10380438+vasileio@users.noreply.github.com> Date: Wed, 5 Nov 2025 09:44:17 +0000 Subject: [PATCH] Fix Shelly Gen 2 power_get() Fix KeyError in shelly_gen2 power_get() function due to incorrect JSON response parsing. Signed-off-by: Vasileios Bimpikas <10380438+vasileio@users.noreply.github.com> --- labgrid/driver/power/shelly_gen2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labgrid/driver/power/shelly_gen2.py b/labgrid/driver/power/shelly_gen2.py index 012f2cc03..652eca806 100644 --- a/labgrid/driver/power/shelly_gen2.py +++ b/labgrid/driver/power/shelly_gen2.py @@ -27,4 +27,4 @@ def power_get(host: str, port: int, index: int = 0): payload = {"id": 1, "method": "Switch.GetStatus", "params": {"id": index}} r = requests.post(f"{host}/rpc", json=payload) r.raise_for_status() - return r.json()["output"] + return r.json()["result"]["output"]