Skip to content

Commit

Permalink
Always Include Acurite Precipitation Rate, Even When Zero
Browse files Browse the repository at this point in the history
  • Loading branch information
leoherzog committed Jan 1, 2025
1 parent 159818f commit ea57c79
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions code.gs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const cwopValidationCode = null;
*/

let version = 'v2.9.1';
let version = 'v2.9.2b';

function Schedule() {
if (updateWunderground && datasource === 'ibm' && ibmStationID === wundergroundStationID) throw 'Error: You are currently set to pull data from Wunderground and also send data to Wunderground. Please disable one or the other to avoid duplicate data.';
Expand Down Expand Up @@ -366,8 +366,13 @@ function refreshFromAcurite_() {
"in": rain.chart_unit === 'in' ? Number(rain.last_reading_value).toFixedNumber(3) : Number(rain.last_reading_value).mmToIn().toFixedNumber(3),
"mm": rain.chart_unit === 'mm' ? Number(rain.last_reading_value).toFixedNumber(2) : Number(rain.last_reading_value).inTomm().toFixedNumber(2)
};

// but the rate is not
conditions.precipRate = {
"in": 0,
"mm": 0
};

// calculate rate from most recent accumulation difference
let lastRainReading = CacheService.getScriptCache().get('lastAcuriteRainReading');
let lastRainTime = CacheService.getScriptCache().get('lastAcuriteRainTime');
Expand Down

0 comments on commit ea57c79

Please sign in to comment.