Skip to content

Commit

Permalink
fix: new device_id for THD (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernst79 authored Jan 4, 2023
1 parent 90a2361 commit a5a780f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bluemaestro_ble/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a5a780f

Please sign in to comment.