From 35ed1fe1e816956ef39f1f5c8d22c694710d85a5 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Tue, 19 Nov 2019 05:28:34 -0600 Subject: [PATCH] Release v0.2.3: Fix underflow of negative temperature values --- CHANGELOG.md | 8 ++++++++ src/brokkr/_version.py | 2 +- src/brokkr/sunsaver.py | 9 +++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b52e248..af6648a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Brokkr Changelog +## Version 0.2.3 (2019-11-18) + +Bugfix release with the following change: + +* Fix pseudo-underflow in temperature data due to incorrect int interpretation + + + ## Version 0.2.2 (2019-10-28) Bugfix release with the following changes: diff --git a/src/brokkr/_version.py b/src/brokkr/_version.py index 2bbc4fe..e69fea6 100644 --- a/src/brokkr/_version.py +++ b/src/brokkr/_version.py @@ -1,4 +1,4 @@ """Version file.""" -VERSION_INFO = (0, 2, 2) +VERSION_INFO = (0, 2, 3) __version__ = '.'.join((str(version) for version in VERSION_INFO)) diff --git a/src/brokkr/sunsaver.py b/src/brokkr/sunsaver.py index a783fa4..8c2533a 100644 --- a/src/brokkr/sunsaver.py +++ b/src/brokkr/sunsaver.py @@ -28,10 +28,10 @@ ("adc_vl_f", "V"), ("adc_ic_f", "A"), ("adc_il_f", "A"), - ("t_hs", "F"), - ("t_batt", "F"), - ("t_amb", "F"), - ("t_rts", "F"), + ("t_hs", "T"), + ("t_batt", "T"), + ("t_amb", "T"), + ("t_rts", "T"), ("charge_state", "S"), ("array_fault", "B"), ("vb_f", "V"), @@ -76,6 +76,7 @@ "S": lambda val: str(val), "I": lambda val: int(val), "F": lambda val: float(val), + "T": lambda val: float(val) - 2**16 if val > 2**8 else float(val), "B": lambda val: format(val, "b").zfill(16), "BL": lambda hi, lo: format(hi << 16 | lo, "b").zfill(32), "V": lambda val: round(val * 100 * 2 ** -15, 3),