Skip to content

Commit b895534

Browse files
committed
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 <[email protected]>
1 parent f63dfd7 commit b895534

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

labgrid/driver/power/shelly_gen2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ def power_get(host: str, port: int, index: int = 0):
2727
payload = {"id": 1, "method": "Switch.GetStatus", "params": {"id": index}}
2828
r = requests.post(f"{host}/rpc", json=payload)
2929
r.raise_for_status()
30-
return r.json()["output"]
30+
return r.json()["result"]["output"]

0 commit comments

Comments
 (0)