mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-14 07:04:26 -04:00
Restore last command parameters
This commit is contained in:
parent
fc8c92d538
commit
ef4f7f7398
3 changed files with 24 additions and 1 deletions
|
@ -84,6 +84,14 @@ class HonConnection:
|
|||
return {}
|
||||
return result
|
||||
|
||||
async def command_history(self, device: HonDevice):
|
||||
url = f"{const.API_URL}/commands/v1/appliance/{device.mac_address}/history"
|
||||
async with self._session.get(url, headers=await self._headers) as response:
|
||||
result = await response.json()
|
||||
if not result or not result.get("payload"):
|
||||
return {}
|
||||
return result["payload"]["history"]
|
||||
|
||||
async def load_attributes(self, device: HonDevice, loop=False):
|
||||
params = {
|
||||
"macAddress": device.mac_address,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue