From 22a98e1781cbab0bbeeb4c917e898d9b49cd4230 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Sun, 14 May 2023 23:04:36 +0200 Subject: [PATCH] Add favorites request --- pyhon/connection/api.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pyhon/connection/api.py b/pyhon/connection/api.py index a0fc08b..26038ca 100644 --- a/pyhon/connection/api.py +++ b/pyhon/connection/api.py @@ -100,6 +100,16 @@ class HonAPI: return {} return result["payload"]["history"] + async def command_favourites(self, appliance: HonAppliance) -> Dict: + url: str = ( + f"{const.API_URL}/commands/v1/appliance/{appliance.mac_address}/favourite" + ) + async with self._hon.get(url) as response: + result: Dict = await response.json() + if not result or not result.get("payload"): + return {} + return result["payload"]["favourites"] + async def last_activity(self, appliance: HonAppliance) -> Dict: url: str = f"{const.API_URL}/commands/v1/retrieve-last-activity" params: Dict = {"macAddress": appliance.mac_address}