mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-13 22:54:26 -04:00
Make 'code' attribute optional, fix hon#51
This commit is contained in:
parent
b5af81b744
commit
af4fbdd8cd
3 changed files with 17 additions and 8 deletions
|
@ -83,6 +83,8 @@ class HonAPI:
|
|||
params["firmwareId"] = firmware_id
|
||||
if firmware_version := appliance.info.get("fwVersion"):
|
||||
params["fwVersion"] = firmware_version
|
||||
if code := appliance.info.get("code"):
|
||||
params["code"] = code
|
||||
url: str = f"{const.API_URL}/commands/v1/retrieve"
|
||||
async with self._hon.get(url, params=params) as response:
|
||||
result: Dict = (await response.json()).get("payload", {})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue