mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-01-19 02:50:44 +00:00
Use firmware version optional
This commit is contained in:
parent
b011d98e07
commit
9594b9ebd8
|
@ -75,13 +75,14 @@ class HonAPI:
|
|||
"code": appliance.info["code"],
|
||||
"applianceModelId": appliance.appliance_model_id,
|
||||
"macAddress": appliance.mac_address,
|
||||
"fwVersion": appliance.info["fwVersion"],
|
||||
"os": const.OS,
|
||||
"appVersion": const.APP_VERSION,
|
||||
"series": appliance.info["series"],
|
||||
}
|
||||
if firmware_id := appliance.info.get("eepromId"):
|
||||
params["firmwareId"] = firmware_id
|
||||
if firmware_version := appliance.info.get("fwVersion"):
|
||||
params["fwVersion"] = firmware_version
|
||||
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…
Reference in a new issue