diff --git a/code/espurna/pow.ino b/code/espurna/pow.ino index a575baf7..bb6b0fe7 100644 --- a/code/espurna/pow.ino +++ b/code/espurna/pow.ino @@ -242,7 +242,7 @@ void powLoop() { reactive = (apparent > power) ? sqrt(apparent * apparent - power * power) : 0; factor = (apparent > 0) ? 100 * power / apparent : 100; if (factor > 100) factor = 100; - unsigned long window = (double) POW_REPORT_EVERY * POW_UPDATE_INTERVAL / 1000.0 / 3600.0; + double window = (double) POW_REPORT_EVERY * POW_UPDATE_INTERVAL / 1000.0 / 3600.0; _energy += power * window; saveEnergy();