From 00ac6912e245a5590d34ac7b4f3563f6f27293b5 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Sun, 5 Mar 2023 19:03:03 +0100 Subject: [PATCH] Fixed setting wrong current value --- pyhon/parameter.py | 6 +++--- setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyhon/parameter.py b/pyhon/parameter.py index 1f3ffe9..f1dcb36 100644 --- a/pyhon/parameter.py +++ b/pyhon/parameter.py @@ -76,7 +76,7 @@ class HonParameterRange(HonParameter): @value.setter def value(self, value): if self._min <= value <= self._max and not value % self._step: - self._value = self._value + self._value = value else: raise ValueError(f"Allowed: min {self._min} max {self._max} step {self._step}") @@ -102,7 +102,7 @@ class HonParameterEnum(HonParameter): @value.setter def value(self, value): if value in self.values: - self._value = self._value + self._value = value else: raise ValueError(f"Allowed values {self._value}") @@ -123,4 +123,4 @@ class HonParameterProgram(HonParameterEnum): if value in self.values: self._command.set_program(value) else: - raise ValueError(f"Allowed values {self._value}") + raise ValueError(f"Allowed values {self._values}") diff --git a/setup.py b/setup.py index ccf7d1b..931b05b 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.2.2", + version="0.2.4", author="Andre Basche", description="Control hOn devices with python", long_description=long_description,