Skip to content

Conversation

murtas
Copy link
Contributor

@murtas murtas commented Jul 9, 2022

Per specification the broadcast message byte 3 includes the device temperature and humidity alert status flags and the decimal temperature (in the last 4 bits). Therefore, only the last 4 bits should be considered to extract the temperature in Celsius.

Without this fix, when the sensor is within the alert range the flags cause the temperature to interpreted incorrectly.

Per [specification the broadcast message](https://github.com/OpenWonderLabs/SwitchBotAPI-BLE/blob/latest/devicetypes/meter.md#meter-broadcast-message-format) byte 3 includes the device temperature and humidity alert status flags and the decimal temperature (in the last 4 bits). Therefore, only the last 4 bits should be considered to extract the temperature in Celsius.

Without this fix, when the sensor is within the alert range the flags cause the temperature to interpreted incorrectly.
@Danielhiversen Danielhiversen merged commit e591eae into sblibs:master Jul 14, 2022
@murtas murtas deleted the discard-sensor-temperature-alert-flags branch July 14, 2022 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants