From 9fea1634b1b71cc0bd7115c1a8425202a27a808f Mon Sep 17 00:00:00 2001 From: olli-t <109417047+olli-t@users.noreply.github.com> Date: Mon, 18 Jul 2022 14:17:16 +0200 Subject: [PATCH] power: fix Hue implementation Signed-off-by: Oliver Tetz olli.codes.some.lines@gmail.com --- moonraker/components/power.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moonraker/components/power.py b/moonraker/components/power.py index 96ccf8b..660fe6a 100644 --- a/moonraker/components/power.py +++ b/moonraker/components/power.py @@ -1301,7 +1301,7 @@ class HueDevice(HTTPDevice): ) url = self.client.escape_url(url) ret = await self.client.request("PUT", url, body={"on": new_state}) - resp = cast(List[Dict[str, Dict[str, Any]]], ret) + resp = cast(List[Dict[str, Dict[str, Any]]], ret.json()) return ( "on" if resp[0]["success"][f"/lights/{self.device_id}/state/on"] else "off" @@ -1313,7 +1313,7 @@ class HueDevice(HTTPDevice): ) url = self.client.escape_url(url) ret = await self.client.request("GET", url) - resp = cast(Dict[str, Dict[str, Any]], ret) + resp = cast(Dict[str, Dict[str, Any]], ret.json()) return "on" if resp["state"]["on"] else "off"