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) {
|
if (currentWeekDay != lastWeekDay) {
|
||||||
|
|
||||||
for (auto& inv : _inverters) {
|
for (auto& inv : _inverters) {
|
||||||
// Have to reset the offets first, otherwise it will
|
inv->performDailyTask();
|
||||||
// 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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lastWeekDay = currentWeekDay;
|
lastWeekDay = currentWeekDay;
|
||||||
|
|||||||
@ -273,6 +273,20 @@ uint8_t InverterAbstract::verifyAllFragments(CommandAbstract& cmd)
|
|||||||
return FRAGMENT_OK;
|
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()
|
void InverterAbstract::resetRadioStats()
|
||||||
{
|
{
|
||||||
RadioStats = {};
|
RadioStats = {};
|
||||||
|
|||||||
@ -65,6 +65,8 @@ public:
|
|||||||
void addRxFragment(const uint8_t fragment[], const uint8_t len);
|
void addRxFragment(const uint8_t fragment[], const uint8_t len);
|
||||||
uint8_t verifyAllFragments(CommandAbstract& cmd);
|
uint8_t verifyAllFragments(CommandAbstract& cmd);
|
||||||
|
|
||||||
|
void performDailyTask();
|
||||||
|
|
||||||
void resetRadioStats();
|
void resetRadioStats();
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user