Skip to content

Commit

Permalink
Bugfix minus degrees
Browse files Browse the repository at this point in the history
  • Loading branch information
JsBergbau authored Nov 29, 2020
1 parent b8b59c4 commit 439b88b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions LYWSD03MMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,9 @@ def le_advertise_packet_handler(mac, adv_type, data, rssi):
measurement.timestamp = int(time.time())



temperature = int(data_str[22:26],16) / 10.
print("rohwerte: ",data_str[22:26])
#temperature = int(data_str[22:26],16) / 10.
temperature = int.from_bytes(bytearray.fromhex(data_str[22:26]),byteorder='big',signed=True) / 10.
print("Temperature: ", temperature)
humidity = int(data_str[26:28], 16)
print("Humidity: ", humidity)
Expand Down

0 comments on commit 439b88b

Please sign in to comment.