Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
7bd3aac7c5 | |||
365a37b42d | |||
2bde6bb61c | |||
ccff32e6c1 |
@ -142,8 +142,13 @@ class HonAppliance:
|
|||||||
if last is None:
|
if last is None:
|
||||||
continue
|
continue
|
||||||
parameters = command_history[last].get("command", {}).get("parameters", {})
|
parameters = command_history[last].get("command", {}).get("parameters", {})
|
||||||
if command.categories and parameters.get("category"):
|
if command.categories and (
|
||||||
command.category = parameters.pop("category").split(".")[-1].lower()
|
parameters.get("program") or parameters.get("category")
|
||||||
|
):
|
||||||
|
if parameters.get("program"):
|
||||||
|
command.category = parameters.pop("program").split(".")[-1].lower()
|
||||||
|
else:
|
||||||
|
command.category = parameters.pop("category")
|
||||||
command = self.commands[name]
|
command = self.commands[name]
|
||||||
for key, data in command.settings.items():
|
for key, data in command.settings.items():
|
||||||
if (
|
if (
|
||||||
|
@ -85,8 +85,8 @@ class HonCommand:
|
|||||||
self._parameters[name] = HonParameterProgram(name, self, "custom")
|
self._parameters[name] = HonParameterProgram(name, self, "custom")
|
||||||
|
|
||||||
async def send(self) -> bool:
|
async def send(self) -> bool:
|
||||||
params = self.parameter_groups["parameters"]
|
params = self.parameter_groups.get("parameters", {})
|
||||||
ancillary_params = self.parameter_groups["ancillary_parameters"]
|
ancillary_params = self.parameter_groups.get("ancillaryParameters", {})
|
||||||
return await self._api.send_command(
|
return await self._api.send_command(
|
||||||
self._appliance, self._name, params, ancillary_params
|
self._appliance, self._name, params, ancillary_params
|
||||||
)
|
)
|
||||||
|
@ -12,7 +12,10 @@ class HonParameterProgram(HonParameterEnum):
|
|||||||
def __init__(self, key: str, command: "HonCommand", group: str) -> None:
|
def __init__(self, key: str, command: "HonCommand", group: str) -> None:
|
||||||
super().__init__(key, {}, group)
|
super().__init__(key, {}, group)
|
||||||
self._command = command
|
self._command = command
|
||||||
self._value: str = command.category
|
if "PROGRAM" in command.category:
|
||||||
|
self._value = command.category.split(".")[-1].lower()
|
||||||
|
else:
|
||||||
|
self._value = command.category
|
||||||
self._programs: Dict[str, "HonCommand"] = command.categories
|
self._programs: Dict[str, "HonCommand"] = command.categories
|
||||||
self._typology: str = "enum"
|
self._typology: str = "enum"
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -7,7 +7,7 @@ with open("README.md", "r") as f:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="pyhOn",
|
name="pyhOn",
|
||||||
version="0.10.1",
|
version="0.10.4",
|
||||||
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,
|
||||||
|
Reference in New Issue
Block a user