mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-12-22 18:55:32 +00:00
Add favorites request
This commit is contained in:
parent
2feb3295e1
commit
22a98e1781
|
@ -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