Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions adafruit_ble_lywsd03mmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ def temperature_humidity(self) -> Optional[Tuple[float, int]]:
data = self._readings_buf
length = self.readings.readinto(data)
if length > 0:
low_temp, high_temp, hum = struct.unpack_from("<BBB", data)
sign = high_temp & 0x80
temp = ((high_temp & 0x7F) << 8) | low_temp
if sign:
temp = temp - 32767
temp, hum = struct.unpack_from("<hB", data)
temp = temp / 100
return (temp, hum)
# No data.
Expand Down