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

更改保存电量时间为一小时,避免频繁写入flash #18

Merged
merged 1 commit into from
May 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
}