Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

[Blukii] Fixed temperature decoding #6564

Merged
merged 1 commit into from
Nov 23, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* Blukii data decoding.
*
* @author Markus Rathgeb - Initial contribution (migrate from handler)
* @author Markus Rathgeb - Fixed temperature decoding
*/
@NonNullByDefault
public class BlukiiDataDecoder {
Expand Down Expand Up @@ -69,7 +70,7 @@ private static Environment processEnvironmentData(byte[] data) {
double pressure = doubleByteToInt(data[15], data[16]) / 10;
int luminance = doubleByteToInt(data[17], data[18]);
int humidity = data[19] & 0xFF;
double temperature = (data[20] & 0xFF) + (data[21] & 0xFF) / 100000000;
double temperature = (data[20] << 8 | data[21] & 0xFF) / 256d;

return new Environment(pressure, luminance, humidity, temperature);
}
Expand Down