Skip to content

Commit

Permalink
更改保存电量时间为一小时,避免频繁写入flash
Browse files Browse the repository at this point in the history
  • Loading branch information
gitercn authored May 30, 2022
1 parent e6694ba commit fa295c1
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 fa295c1

Please sign in to comment.