From a5a780f677efff245240948aa4023b120805050f Mon Sep 17 00:00:00 2001 From: Ernst Klamer Date: Wed, 4 Jan 2023 20:06:50 +0100 Subject: [PATCH] fix: new device_id for THD (#4) --- src/bluemaestro_ble/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bluemaestro_ble/parser.py b/src/bluemaestro_ble/parser.py index bf56fec..6d5b36f 100644 --- a/src/bluemaestro_ble/parser.py +++ b/src/bluemaestro_ble/parser.py @@ -29,6 +29,7 @@ class BlueMaestroDevice: DEVICE_TYPES = { + 0x16: BlueMaestroDevice("Tempo Disc THD", Struct("!BhhhHhH").unpack), 0x17: BlueMaestroDevice("Tempo Disc THD", Struct("!BhhhHhH").unpack), 0x1B: BlueMaestroDevice("Tempo Disc THPD", Struct("!BhhhHhH").unpack), } @@ -61,7 +62,7 @@ def _start_update(self, service_info: BluetoothServiceInfo) -> None: self.set_device_name(f"{name} {short_address(service_info.address)}") self.set_device_manufacturer("BlueMaestro") unpacked = device.unpack(data[1:14]) - if device_id == 0x17: + if device_id in [0x16, 0x17]: (batt, time_interval, log_cnt, temp, humi, dew_point, mode) = unpacked self.update_predefined_sensor( SensorLibrary.DEW_POINT__TEMP_CELSIUS, dew_point / 10