From ad864286fcd3530211edd877795f26d154cd1122 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Sun, 23 Apr 2023 14:40:39 +0200 Subject: [PATCH] Use firmware id optional --- pyhon/connection/api.py | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyhon/connection/api.py b/pyhon/connection/api.py index 4852a10..a28cce5 100644 --- a/pyhon/connection/api.py +++ b/pyhon/connection/api.py @@ -74,13 +74,14 @@ async def load_commands(self, appliance: HonAppliance) -> Dict: "applianceType": appliance.appliance_type, "code": appliance.info["code"], "applianceModelId": appliance.appliance_model_id, - "firmwareId": appliance.info["eepromId"], "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 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", {}) diff --git a/setup.py b/setup.py index 754daa7..2d7fd96 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="pyhOn", - version="0.8.2", + version="0.8.3", author="Andre Basche", description="Control hOn devices with python", long_description=long_description,