From fc842c0aee9aa2ed5d0a9e35bd237bbadca5ff89 Mon Sep 17 00:00:00 2001 From: kelu16 Date: Tue, 9 Feb 2021 22:22:48 +0100 Subject: [PATCH] Fix unpacking negative temperature The temperature got unpacked as an unsigned short. This needs to be a signed short because temperatures can be negative --- custom_components/thermoplus_ble/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/thermoplus_ble/sensor.py b/custom_components/thermoplus_ble/sensor.py index 467e444..b2937c7 100644 --- a/custom_components/thermoplus_ble/sensor.py +++ b/custom_components/thermoplus_ble/sensor.py @@ -143,7 +143,7 @@ def parse_sensor(self, data): if len(value) != 19: continue Payload = namedtuple('Payload', 'battery temperature humidity') - payload = Payload._make(struct.unpack('