Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible solution to Cumulative totals resetting #1632

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Modules/feed/feed_model.php
Expand Up @@ -542,6 +542,10 @@ public function get_timevalue($id)
$lastvalue['value'] = (float) $lastvalue['value'];
}
// CHAVEIRO comment: Can return NULL as a valid number or else processlist logic will be broken
// Test for avoid to reset PowerToKWh process feed
if (is_null($lastvalue['time']) || is_null($lastvalue['value'])) {
$lastvalue = $this->EngineClass($engine)->lastvalue($id);
}
} else {
// if it does not, load it in to redis from the actual feed data because we have no updated data from sql feeds table with redis enabled.
$lastvalue = $this->EngineClass($engine)->lastvalue($id);
Expand Down