From 2a819b638a6dea0223d7e143c7ab0329bab4ad4f Mon Sep 17 00:00:00 2001 From: Ilias Daradimos Date: Mon, 13 Mar 2023 16:16:52 +0200 Subject: [PATCH] Add measurement type (glukose/ketone) and units Signed-off-by: Ilias Daradimos --- glucometerutils/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glucometerutils/common.py b/glucometerutils/common.py index 2760ce8..c1fe98a 100644 --- a/glucometerutils/common.py +++ b/glucometerutils/common.py @@ -77,9 +77,10 @@ def get_value_as(self, to_unit: Unit) -> float: def as_csv(self, unit: Unit) -> str: """Returns the reading as a formatted comma-separated value string.""" - return '"%s","%.2f","%s","%s","%s"' % ( + return '"%s","BG","%.2f","%s","%s","%s","%s"' % ( self.timestamp, self.get_value_as(unit), + unit.value, self.meal.value, self.measure_method.value, self.comment, @@ -102,7 +103,7 @@ def as_csv(self, unit: Unit) -> str: """Returns the reading as a formatted comma-separated value string.""" del unit # Unused for Ketone readings. - return '"%s","%.2f","","%s","%s"' % ( + return '"%s","BK","%.2f","mmol/L","","%s","%s"' % ( self.timestamp, self.value, self.measure_method.value,