From 9f130e2e859c0e0b7ff1916267d962e2f51645c4 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Fri, 19 May 2023 00:48:08 +0200 Subject: [PATCH] Make 'code' attribute really optional --- pyhon/appliance.py | 2 +- pyhon/connection/api.py | 1 - pyhon/hon.py | 2 +- setup.py | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyhon/appliance.py b/pyhon/appliance.py index 64e18a5..a518076 100644 --- a/pyhon/appliance.py +++ b/pyhon/appliance.py @@ -276,7 +276,7 @@ class HonAppliance: extra = {n: c.data for n, c in self._commands.items() if c.data} if extra: data |= {"extra_command_data": extra} - for sensible in ["PK", "SK", "serialNumber", "code", "coords", "device"]: + for sensible in ["PK", "SK", "serialNumber", "coords", "device"]: data.get("appliance", {}).pop(sensible, None) result = helper.pretty_print({"data": data}, whitespace=whitespace) result += helper.pretty_print( diff --git a/pyhon/connection/api.py b/pyhon/connection/api.py index 4e5fc6d..aace11a 100644 --- a/pyhon/connection/api.py +++ b/pyhon/connection/api.py @@ -72,7 +72,6 @@ class HonAPI: async def load_commands(self, appliance: HonAppliance) -> Dict: params: Dict = { "applianceType": appliance.appliance_type, - "code": appliance.info["code"], "applianceModelId": appliance.appliance_model_id, "macAddress": appliance.mac_address, "os": const.OS, diff --git a/pyhon/hon.py b/pyhon/hon.py index 31fa275..2f22dc1 100644 --- a/pyhon/hon.py +++ b/pyhon/hon.py @@ -83,7 +83,7 @@ class Hon: ) except (KeyError, ValueError, IndexError) as error: _LOGGER.exception(error) - _LOGGER.error(f"Device data - %s", appliance_data) + _LOGGER.error("Device data - %s", appliance_data) self._appliances.append(appliance) async def setup(self) -> None: diff --git a/setup.py b/setup.py index 6fbedf7..1f85329 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.10.8", + version="0.10.9", author="Andre Basche", description="Control hOn devices with python", long_description=long_description,