Move inverter housekeeping tasks inside the InverterAbstract class
This commit is contained in:
parent
93b6e5a885
commit
0c012bf62a
@ -136,16 +136,7 @@ void HoymilesClass::loop()
|
||||
if (currentWeekDay != lastWeekDay) {
|
||||
|
||||
for (auto& inv : _inverters) {
|
||||
// Have to reset the offets first, otherwise it will
|
||||
// Substract the offset from zero which leads to a high value
|
||||
inv->Statistics()->resetYieldDayCorrection();
|
||||
if (inv->getZeroYieldDayOnMidnight()) {
|
||||
inv->Statistics()->zeroDailyData();
|
||||
}
|
||||
if (inv->getClearEventlogOnMidnight()) {
|
||||
inv->EventLog()->clearBuffer();
|
||||
}
|
||||
inv->resetRadioStats();
|
||||
inv->performDailyTask();
|
||||
}
|
||||
|
||||
lastWeekDay = currentWeekDay;
|
||||
|
||||
@ -273,6 +273,20 @@ uint8_t InverterAbstract::verifyAllFragments(CommandAbstract& cmd)
|
||||
return FRAGMENT_OK;
|
||||
}
|
||||
|
||||
void InverterAbstract::performDailyTask()
|
||||
{
|
||||
// Have to reset the offets first, otherwise it will
|
||||
// Substract the offset from zero which leads to a high value
|
||||
Statistics()->resetYieldDayCorrection();
|
||||
if (getZeroYieldDayOnMidnight()) {
|
||||
Statistics()->zeroDailyData();
|
||||
}
|
||||
if (getClearEventlogOnMidnight()) {
|
||||
EventLog()->clearBuffer();
|
||||
}
|
||||
resetRadioStats();
|
||||
}
|
||||
|
||||
void InverterAbstract::resetRadioStats()
|
||||
{
|
||||
RadioStats = {};
|
||||
|
||||
@ -65,6 +65,8 @@ public:
|
||||
void addRxFragment(const uint8_t fragment[], const uint8_t len);
|
||||
uint8_t verifyAllFragments(CommandAbstract& cmd);
|
||||
|
||||
void performDailyTask();
|
||||
|
||||
void resetRadioStats();
|
||||
|
||||
struct {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user