Merge pull request #9160 from povlhp/development

Update xnrg_01_hlw8012.ino to increase power precision.
This commit is contained in:
Adrian Scillato 2020-08-25 10:40:43 -03:00 committed by GitHub
commit e11020f0c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -205,10 +205,10 @@ void HlwEverySecond(void)
unsigned long hlw_len;
if (Hlw.energy_period_counter) {
hlw_len = 10000 / Hlw.energy_period_counter;
hlw_len = 10000 * 1000 / Hlw.energy_period_counter;
Hlw.energy_period_counter = 0;
if (hlw_len) {
Energy.kWhtoday_delta += ((Hlw.power_ratio * Settings.energy_power_calibration) / hlw_len) / 36;
Energy.kWhtoday_delta += ((Hlw.power_ratio * Settings.energy_power_calibration) * 1000 / hlw_len) / 36;
EnergyUpdateToday();
}
}