Fix command start

This commit is contained in:
Andre Basche 2023-03-08 23:01:40 +01:00
parent f52f84711f
commit 6b346f766f
4 changed files with 4 additions and 3 deletions

View File

@ -129,7 +129,7 @@ class HonConnection:
}, },
"ancillaryParameters": ancillary_parameters, "ancillaryParameters": ancillary_parameters,
"parameters": parameters, "parameters": parameters,
"applianceType": device.appliance_type_name "applianceType": device.appliance_type
} }
url = f"{const.API_URL}/commands/v1/send" url = f"{const.API_URL}/commands/v1/send"
async with self._session.post(url, headers=await self._headers, json=data) as resp: async with self._session.post(url, headers=await self._headers, json=data) as resp:

View File

@ -6,4 +6,5 @@ class Appliance:
if self._data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED": if self._data["attributes"]["lastConnEvent"]["category"] == "DISCONNECTED":
self._data["attributes"]["parameters"]["machMode"] = "0" self._data["attributes"]["parameters"]["machMode"] = "0"
self._data["active"] = bool(self._data.get("activity")) self._data["active"] = bool(self._data.get("activity"))
self._data["pause"] = self._data["attributes"]["parameters"]["machMode"] == "3"
return self._data return self._data

View File

@ -38,7 +38,7 @@ class HonCommand:
return {key: parameter.value for key, parameter in self._ancillary_parameters.items()} return {key: parameter.value for key, parameter in self._ancillary_parameters.items()}
async def send(self): 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) return await self._connector.send_command(self._device, self._name, parameters, self.ancillary_parameters)
def get_programs(self): def get_programs(self):

View File

@ -7,7 +7,7 @@ with open("README.md", "r") as f:
setup( setup(
name="pyhOn", name="pyhOn",
version="0.3.2", version="0.3.3",
author="Andre Basche", author="Andre Basche",
description="Control hOn devices with python", description="Control hOn devices with python",
long_description=long_description, long_description=long_description,