Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
DutchmanNL committed Nov 22, 2023
2 parents 49be151 + 84bb7ea commit 20bb26d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,28 @@ class Sourceanalytix extends utils.Adapter {
// val: await this.getStateAsync(`${stateID}.currentYear.meterReadings.previousWeek.${weekdays[x]}`),
// ack: true
// })

//derelvis
if (beforeReset.day !== actualDate.day) {
await this.setPreviousValues(`${stateDetails.deviceName}.cumulativeReading`, `${stateDetails.deviceName}.currentYear.meterReadings.01_previousDay`);
}

if (beforeReset.week !== actualDate.week) {
await this.setPreviousValues(`${stateDetails.deviceName}.cumulativeReading`, `${stateDetails.deviceName}.currentYear.meterReadings.02_previousWeek`);
}

if (beforeReset.month !== actualDate.month) {
await this.setPreviousValues(`${stateDetails.deviceName}.cumulativeReading`, `${stateDetails.deviceName}.currentYear.meterReadings.03_previousMonth`);
}

if (beforeReset.quarter !== actualDate.quarter) {
await this.setPreviousValues(`${stateDetails.deviceName}.cumulativeReading`, `${stateDetails.deviceName}.currentYear.meterReadings.04_previousQuarter`);
}

if (beforeReset.year !== actualDate.year) {
await this.setPreviousValues(`${stateDetails.deviceName}.cumulativeReading`, `${stateDetails.deviceName}.currentYear.meterReadings.05_previousYear`);
}
//derelvis end

}

Expand Down

0 comments on commit 20bb26d

Please sign in to comment.