# HG changeset patch # User Daniel O'Connor # Date 1640061332 -37800 # Node ID 3090d8bf424208cfcb03751a4758ed5545ca8efd # Parent 64d0d5aaf329d635fd8bc84252f81300919900e4 Fix temperature decoding. diff -r 64d0d5aaf329 -r 3090d8bf4242 epro.py --- a/epro.py Tue Dec 14 13:04:12 2021 +1030 +++ b/epro.py Tue Dec 21 15:05:32 2021 +1030 @@ -139,8 +139,8 @@ def __init__(self, dstadr, srcadr, devid, msgtype, data): super(BatteryTemperature, self).__init__(dstadr, srcadr, devid, msgtype, data) - self.temp = (data[2] & 0x7f | (data[1] & 0x7f) << 7 | (data[0] & 0x3f) << 14) / 10.0 - if data[2] & 0x40: + self.temp = (data[2] & 0x7f | (data[1] & 0x7f) << 7 | (data[0] & 0x03) << 14) / 10.0 + if data[0] & 0x40: self.temp *= -1 if self.temp < -20: self.temp = None