Add favorites request
This commit is contained in:
parent
2feb3295e1
commit
22a98e1781
1 changed files with 10 additions and 0 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue