Skip to content

Commit

Permalink
Merge pull request qlwz#18 from gitercn/master
Browse files Browse the repository at this point in the history
更改保存电量时间为一小时,避免频繁写入flash
  • Loading branch information
qlwz authored May 30, 2022
2 parents e6694ba + fa295c1 commit eefd75a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DC1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ void DC1::energyUpdate()
{
energyUpdateToday();
}
if (perSecond % 301 == 0 && cse7766->Energy.kWhtoday > 0)
if (perSecond % 3600 == 0 && cse7766->Energy.kWhtoday > 0)
{
energySync();
Config::saveConfig();
Expand Down Expand Up @@ -943,4 +943,4 @@ void DC1::reportPower()
powerStatTopic[strlen(powerStatTopic) - 1] = ch + 49; // 48 + 1 + ch
Mqtt::publish(powerStatTopic, bitRead(lastState, ch) ? "on" : "off", globalConfig.mqtt.retain);
}
}
}

0 comments on commit eefd75a

Please sign in to comment.