Skip to content

Commit

Permalink
Fixed setting wrong current value
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre0512 committed Mar 5, 2023
1 parent 0f630e8 commit 00ac691
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pyhon/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def value(self):
@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}")

Expand All @@ -102,7 +102,7 @@ def value(self):
@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}")

Expand All @@ -123,4 +123,4 @@ def value(self, value):
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}")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="pyhOn",
version="0.2.2",
version="0.2.4",
author="Andre Basche",
description="Control hOn devices with python",
long_description=long_description,
Expand Down

0 comments on commit 00ac691

Please sign in to comment.