From 04f19c460993bf37706025d12a762f1c968a4591 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Mon, 17 Apr 2023 00:01:28 +0200 Subject: [PATCH 1/3] Fix error when sending commands --- pyhon/commands.py | 7 +++---- setup.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyhon/commands.py b/pyhon/commands.py index 33487a3..dc7bf0c 100644 --- a/pyhon/commands.py +++ b/pyhon/commands.py @@ -62,11 +62,10 @@ class HonCommand: return self._ancillary_parameters async def send(self) -> bool: - parameters = { - name: parameter.value for name, parameter in self._parameters.items() - } + params = {k: v.value for k, v in self._parameters.items()} + ancillary_params = {k: v.value for k, v in self._ancillary_parameters.items()} return await self._api.send_command( - self._appliance, self._name, parameters, self.ancillary_parameters + self._appliance, self._name, params, ancillary_params ) @property diff --git a/setup.py b/setup.py index 8695cd5..a6fe6cc 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.8.0b5", + version="0.8.0b6", author="Andre Basche", description="Control hOn devices with python", long_description=long_description, From 411effd81483654bbc102afd2a25973c1cbe7c89 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Mon, 17 Apr 2023 00:37:19 +0200 Subject: [PATCH 2/3] Fix disappearing programs --- pyhon/parameter/program.py | 8 ++++---- setup.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyhon/parameter/program.py b/pyhon/parameter/program.py index a41603c..219b658 100644 --- a/pyhon/parameter/program.py +++ b/pyhon/parameter/program.py @@ -1,4 +1,4 @@ -from typing import List, TYPE_CHECKING +from typing import List, TYPE_CHECKING, Dict from pyhon.parameter.enum import HonParameterEnum @@ -13,7 +13,7 @@ class HonParameterProgram(HonParameterEnum): super().__init__(key, {}) self._command = command self._value: str = command.program - self._values: List[str] = list(command.programs) + self._programs: Dict[str, "HonCommand"] = command.programs self._typology: str = "enum" @property @@ -25,9 +25,9 @@ class HonParameterProgram(HonParameterEnum): if value in self.values: self._command.program = value else: - raise ValueError(f"Allowed values {self._values}") + raise ValueError(f"Allowed values {self.values}") @property def values(self) -> List[str]: - values = [v for v in self._values if all(f not in v for f in self._FILTER)] + values = [v for v in self._programs if all(f not in v for f in self._FILTER)] return sorted(values) diff --git a/setup.py b/setup.py index a6fe6cc..f0b8ca6 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.8.0b6", + version="0.8.0b7", author="Andre Basche", description="Control hOn devices with python", long_description=long_description, From b37715d0caea0de0a1d87be181c5685eb20942c9 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Wed, 19 Apr 2023 17:37:55 +0200 Subject: [PATCH 3/3] Bump version to 0.8.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f0b8ca6..3ca2782 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.8.0b7", + version="0.8.0", author="Andre Basche", description="Control hOn devices with python", long_description=long_description,