Fixed setting wrong current value
This commit is contained in:
parent
0f630e854e
commit
00ac6912e2
2 changed files with 4 additions and 4 deletions
|
@ -76,7 +76,7 @@ class HonParameterRange(HonParameter):
|
||||||
@value.setter
|
@value.setter
|
||||||
def value(self, value):
|
def value(self, value):
|
||||||
if self._min <= value <= self._max and not value % self._step:
|
if self._min <= value <= self._max and not value % self._step:
|
||||||
self._value = self._value
|
self._value = value
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Allowed: min {self._min} max {self._max} step {self._step}")
|
raise ValueError(f"Allowed: min {self._min} max {self._max} step {self._step}")
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ class HonParameterEnum(HonParameter):
|
||||||
@value.setter
|
@value.setter
|
||||||
def value(self, value):
|
def value(self, value):
|
||||||
if value in self.values:
|
if value in self.values:
|
||||||
self._value = self._value
|
self._value = value
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Allowed values {self._value}")
|
raise ValueError(f"Allowed values {self._value}")
|
||||||
|
|
||||||
|
@ -123,4 +123,4 @@ class HonParameterProgram(HonParameterEnum):
|
||||||
if value in self.values:
|
if value in self.values:
|
||||||
self._command.set_program(value)
|
self._command.set_program(value)
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Allowed values {self._value}")
|
raise ValueError(f"Allowed values {self._values}")
|
||||||
|
|
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.2.2",
|
version="0.2.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,
|
||||||
|
|
Loading…
Reference in a new issue