Skip to content

Commit

Permalink
Merge pull request #8 from paulianttila/dev
Browse files Browse the repository at this point in the history
Fixed  issue caused by the rounding
  • Loading branch information
paulianttila committed May 15, 2023
2 parents 5a66d4d + 28d066a commit 5681e62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def init(self, callbacks: Callbacks) -> None:
self.logger.debug(f"{self.meter}")

def get_version(self) -> str:
return "2.0.6"
return "2.0.7"

def stop(self) -> None:
def wait_until(condition, interval=0.1, timeout=1, *args):
Expand Down
6 changes: 3 additions & 3 deletions src/meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _round(self) -> None:
)
self.instant_consumption_l_per_min += 0.0 # remove possible negative -0.00
self._litre = round(self._litre, 2)
self._instant_consumption_l = round(self._instant_consumption_l, 2)
self._instant_consumption_l = round(self._instant_consumption_l, 3)
self._instant_consumption_l += 0.0 # remove possible negative -0.00
self._current_value.value = round(self._current_value.value, 5)
self._previous_value.value = round(self._previous_value.value, 5)
self._current_value.value = round(self._current_value.value, 6)
self._previous_value.value = round(self._previous_value.value, 6)

0 comments on commit 5681e62

Please sign in to comment.