Skip to content

Commit

Permalink
MClimate HT - Fix temperature decoding issue (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
Webbeh authored Nov 20, 2024
1 parent ac60fa1 commit f1a61a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vendor/mclimate/ht-sensor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function decodeUplink(input) {
}

function handleKeepalive(bytes, data){
var tempHex = '0' + bytes[1].toString(16) + bytes[2].toString(16);
var tempHex = ("0" + bytes[1].toString(16)).substr(-2) + ("0" + bytes[2].toString(16)).substr(-2);
var tempDec = parseInt(tempHex, 16);
var temperatureValue = calculateTemperature(tempDec);
var humidityValue = calculateHumidity(bytes[3]);
Expand Down Expand Up @@ -105,4 +105,4 @@ function decodeUplink(input) {
} catch (e) {
throw new Error(e);
}
}
}

0 comments on commit f1a61a1

Please sign in to comment.