Skip to content

Commit

Permalink
Fix Tempest breakage (#280)
Browse files Browse the repository at this point in the history
* Fix Tempest breakage

Fix #278, add missing variable declaration.

* Fix Rain Accumulation

Found an additional error now that it has been raining for a while. There is code to handle the case that if several minutes pass between observations, then clear out the old data in the skipped minutes. This was also clearing the last minute, so each time it clicked over a minute, it would erase the last one. This is fixed by clearing just the minutes that are actually skipped, one passed the last recorded to the current minute.

* Update CHANGELOG.md
  • Loading branch information
dacarson authored Feb 5, 2024
1 parent 07da881 commit b97f105
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,8 @@
* Fixed crash when an error occurs in OpenWeatherMap report
* Fixed undefined rain boolean sensor value
* Fixed several Tempest weather station issues
* Improved usage of converter
* Improved usage of converter

## 3.3.3
* Fix Tempest weather station breakage introduced in 3.3.2
* Fix Rain accumulation
7 changes: 4 additions & 3 deletions apis/weatherflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ class TempestAPI
that.rainAccumulation[currentObservationMinute] += mmOfRainInLastMinute;
else {
// Erase the minutes between last recorded minute and current minute
for (var i = that.rainAccumulationMinute; (i % 60) != currentObservationMinute; i++)
for (var i = that.rainAccumulationMinute + 1; (i % 60) != currentObservationMinute; i++)
that.rainAccumulation[i % 60] = 0;
that.rainAccumulation[currentObservationMinute] = mmOfRainInLastMinute;
}
that.rainAccumulationMinute = currentObservationMinute;

accumulation = converter.getRainAccumulated(that.rainAccumulation)
var accumulation = converter.getRainAccumulated(that.rainAccumulation)

this.log.debug("getHourlyAccumulatedRain last minute: " + mmOfRainInLastMinute + " last hour: " + accumulation);
this.log.debug("getHourlyAccumulatedRain last minute: " + mmOfRainInLastMinute + " rainAccumulation: " + this.rainAccumulation + " last hour: " + accumulation);
return accumulation;
}

Expand Down Expand Up @@ -438,3 +438,4 @@ class TempestAPI
module.exports = {
TempestAPI: TempestAPI
};

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "homebridge-weather-plus",
"displayName": "Weather Plus",
"version": "3.3.2",
"version": "3.3.3",
"description": "A comprehensive weather plugin for homekit with current observations, forecasts and history.",
"license": "MIT",
"keywords": [
Expand Down

0 comments on commit b97f105

Please sign in to comment.