From 6b346f766f6dc37d4b7924cb694f9b4034103307 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Wed, 8 Mar 2023 23:01:40 +0100 Subject: [PATCH] Fix command start --- pyhon/api.py | 2 +- pyhon/appliances/wm.py | 1 + pyhon/commands.py | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyhon/api.py b/pyhon/api.py index b8bae29..f53f3d3 100644 --- a/pyhon/api.py +++ b/pyhon/api.py @@ -129,7 +129,7 @@ class HonConnection: }, "ancillaryParameters": ancillary_parameters, "parameters": parameters, - "applianceType": device.appliance_type_name + "applianceType": device.appliance_type } url = f"{const.API_URL}/commands/v1/send" async with self._session.post(url, headers=await self._headers, json=data) as resp: diff --git a/pyhon/appliances/wm.py b/pyhon/appliances/wm.py index 259d808..8664484 100644 --- a/pyhon/appliances/wm.py +++ b/pyhon/appliances/wm.py @@ -6,4 +6,5 @@ class Appliance: if self._data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED": self._data["attributes"]["parameters"]["machMode"] = "0" self._data["active"] = bool(self._data.get("activity")) + self._data["pause"] = self._data["attributes"]["parameters"]["machMode"] == "3" return self._data diff --git a/pyhon/commands.py b/pyhon/commands.py index 4fda746..1878f8a 100644 --- a/pyhon/commands.py +++ b/pyhon/commands.py @@ -38,7 +38,7 @@ class HonCommand: return {key: parameter.value for key, parameter in self._ancillary_parameters.items()} async def send(self): - parameters = {name: parameter.value for name, parameter in self._parameters} + parameters = {name: parameter.value for name, parameter in self._parameters.items()} return await self._connector.send_command(self._device, self._name, parameters, self.ancillary_parameters) def get_programs(self): diff --git a/setup.py b/setup.py index 34c408a..a3be9f3 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.3.2", + version="0.3.3", author="Andre Basche", description="Control hOn devices with python", long_description=long_description,