Skip to content

Commit

Permalink
Merge pull request #35 from vhornik/main
Browse files Browse the repository at this point in the history
Send Time of Measurement to Windguru
  • Loading branch information
leoherzog authored Nov 15, 2024
2 parents 4e2d64f + f404418 commit cbe6333
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code.gs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ function updateWindGuru_() {
let hash = md5_(salt + windGuruStationUID + windGuruStationPassword);
request += '&hash=' + hash;
request += '&interval=60';
request += '&unixtime=' + (conditions.time / 1000).toFixedNumber(0);
if (conditions.temp != null) request += '&temperature=' + conditions.temp.c;
if (conditions.windSpeed != null) request += '&wind_avg=' + conditions.windSpeed.knots;
if (conditions.windGust != null) request += '&wind_max=' + conditions.windGust.knots;
Expand Down Expand Up @@ -1244,4 +1245,4 @@ Number.prototype.heatIndex = function(humidity, units='F') {
let heatIndexF = -42.379 + 2.04901523 * T + 10.14333127 * H - 0.22475541 * T * H - 6.83783 * Math.pow(10, -3) * Math.pow(T, 2) - 5.481717 * Math.pow(10, -2) * Math.pow(H, 2) + 1.22874 * Math.pow(10, -3) * Math.pow(T, 2) * H + 8.5282 * Math.pow(10, -4) * T * Math.pow(H, 2) - 1.99 * Math.pow(10, -6) * Math.pow(T, 2) * Math.pow(H, 2);
return units === 'F' ? heatIndexF : heatIndexF.fToC();
}
Number.prototype.toFixedNumber = function(digits) { return +this.toFixed(digits); }
Number.prototype.toFixedNumber = function(digits) { return +this.toFixed(digits); }

0 comments on commit cbe6333

Please sign in to comment.