From 896265b0b523014ea4b4105e3fe87bdc234e8b62 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Thu, 26 Jan 2017 09:33:51 +0000 Subject: bugfix: EGVRecord.noise() to use self.full_trend() The method EGVRecord.full_trend() is implemented differently on the Dexcom G5. It returns self.data[12] instead of self.data[3]. EGVRecord.noise() had used self.data[3] directly instead of calling self.full_trend(), causing this exception when connecting to a G5 receiver: TypeError: ord() expected string of length 1, but int found I can only assume that this is correct. --- dexcom_reader/database_records.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dexcom_reader/database_records.py b/dexcom_reader/database_records.py index 22ba279..fa09bea 100644 --- a/dexcom_reader/database_records.py +++ b/dexcom_reader/database_records.py @@ -324,7 +324,7 @@ class EGVRecord(GenericTimestampedRecord): @property def noise (self): - return (ord(self.data[3]) & constants.EGV_NOISE_MASK) >> 4 + return (ord(self.full_trend) & constants.EGV_NOISE_MASK) >> 4 def __repr__(self): if self.is_special: return '%s: %s' % (self.display_time, self.glucose_special_meaning) -- cgit v1.2.3