From 29c936b045d6042e0cc6dbeb98e67e1620a23f47 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Sun, 4 Feb 2024 04:21:27 +0100 Subject: [PATCH] Fix path for #22 --- pyhon/hon.py | 6 ++++-- pyhon/parameter/range.py | 14 ++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pyhon/hon.py b/pyhon/hon.py index d6c73e2..dfd117e 100644 --- a/pyhon/hon.py +++ b/pyhon/hon.py @@ -103,8 +103,10 @@ class Hon: ) await self._create_appliance(appliance, self.api) if ( - test_data := self._test_data_path / "hon-test-data" / "test_data" - ).exists() or (test_data := test_data / "test_data").exists(): + self._test_data_path + and (test_data := self._test_data_path / "hon-test-data" / "test_data").exists() + or (test_data := test_data / "..").exists() + ): api = TestAPI(test_data) for appliance in await api.load_appliances(): await self._create_appliance(appliance, api) diff --git a/pyhon/parameter/range.py b/pyhon/parameter/range.py index 76bd2b6..fa00de0 100644 --- a/pyhon/parameter/range.py +++ b/pyhon/parameter/range.py @@ -69,11 +69,9 @@ class HonParameterRange(HonParameter): @property def values(self) -> List[str]: - if isinstance(self.step, float): - result = [] - i = self.min - while i <= self.max: - i += self.step - result.append(str(i)) - return result - return [str(i) for i in range(int(self.min), int(self.max) + 1, int(self.step))] + result = [] + i = self.min + while i < self.max: + i += self.step + result.append(str(i)) + return result