Skip to content

Commit

Permalink
fix: negative temperature (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernst79 authored Dec 17, 2022
1 parent c650f69 commit 8541370
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sensorpro_ble/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _start_update(self, service_info: BluetoothServiceInfo) -> None:
self.set_device_name(f"{name} {short_address(service_info.address)}")
self.set_device_manufacturer("SensorPro")
xvalue = data[10:17]
(volt, temp, humi, batt) = unpack(">hHHB", xvalue)
(volt, temp, humi, batt) = unpack(">HhHB", xvalue)
self.update_predefined_sensor(SensorLibrary.BATTERY__PERCENTAGE, batt)
self.update_predefined_sensor(SensorLibrary.TEMPERATURE__CELSIUS, temp / 100)
self.update_predefined_sensor(SensorLibrary.HUMIDITY__PERCENTAGE, humi / 100)
Expand Down

0 comments on commit 8541370

Please sign in to comment.