From cfc474e81a8ec9a1344fc606833f5bc2d62a2318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Nenze=CC=81n?= Date: Tue, 12 May 2020 01:31:45 +0200 Subject: [PATCH] Rounds SG value on Arilock --- pyplaato/models/airlock.py | 7 ++++++- setup.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pyplaato/models/airlock.py b/pyplaato/models/airlock.py index 12af744..e57bbdf 100644 --- a/pyplaato/models/airlock.py +++ b/pyplaato/models/airlock.py @@ -16,7 +16,7 @@ def __init__(self, attrs): self.volume_unit = attrs.get(self.Pins.VOLUME_UNIT, None) self.bubbles = attrs.get(self.Pins.BUBBLES, None) self.batch_volume = attrs.get(self.Pins.BATCH_VOLUME, None) - self.sg = attrs.get(self.Pins.SG, None) + self.__sg = attrs.get(self.Pins.SG, None) self.og = attrs.get(self.Pins.OG, None) self.__abv = attrs.get(self.Pins.ABV, None) self.__co2_volume = attrs.get(self.Pins.CO2_VOLUME, None) @@ -37,6 +37,11 @@ def abv(self): if self.__abv is not None: return round(float(self.__abv), 2) + @property + def sg(self): + if self.__sg is not None: + return round(float(self.__sg), 3) + @property def co2_volume(self): if self.__co2_volume is not None: diff --git a/setup.py b/setup.py index 009e9dd..9057105 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="pyplaato", - version="0.0.12", + version="0.0.13", author="JohNan", author_email="johan.nanzen@gmail.com", description="Asynchronous Python client for getting Plaato Airlock and Keg data",