mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-30 01:06:11 +02:00
0.8.118
* possible fix reset max values #1609 * slightly improved WiFi reconnect
This commit is contained in:
parent
bf78c6ab0d
commit
d43ebc6c5a
7 changed files with 36 additions and 40 deletions
24
src/app.cpp
24
src/app.cpp
|
@ -353,20 +353,9 @@ void app::tickMidnight(void) {
|
|||
// reset alarms
|
||||
if(InverterStatus::OFF == iv->getStatus())
|
||||
iv->resetAlarms();
|
||||
|
||||
// clear max values
|
||||
if(mConfig->inst.rstMaxValsMidNight) {
|
||||
record_t<> *rec = iv->getRecordStruct(RealTimeRunData_Debug);
|
||||
for(uint8_t i = 0; i <= iv->channels; i++) {
|
||||
uint8_t pos = iv->getPosByChFld(i, FLD_MP, rec);
|
||||
iv->setValue(pos, rec, 0.0f);
|
||||
}
|
||||
if(InverterStatus::OFF == iv->getStatus())
|
||||
iv->resetAlarms(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (mConfig->inst.rstYieldMidNight) {
|
||||
if (mConfig->inst.rstValsAtMidNight) {
|
||||
zeroIvValues(!CHECK_AVAIL, !SKIP_YIELD_DAY);
|
||||
|
||||
#if defined(ENABLE_MQTT)
|
||||
|
@ -470,12 +459,15 @@ void app:: zeroIvValues(bool checkAvail, bool skipYieldDay) {
|
|||
pos = iv->getPosByChFld(ch, fld, rec);
|
||||
iv->setValue(pos, rec, 0.0f);
|
||||
}
|
||||
// zero max power
|
||||
if(!skipYieldDay) {
|
||||
// zero max power and max temperature
|
||||
if(mConfig->inst.rstIncludeMaxVals) {
|
||||
pos = iv->getPosByChFld(ch, FLD_MP, rec);
|
||||
iv->setValue(pos, rec, 0.0f);
|
||||
}
|
||||
iv->resetAlarms(true);
|
||||
pos = iv->getPosByChFld(ch, FLD_MT, rec);
|
||||
iv->setValue(pos, rec, 0.0f);
|
||||
iv->resetAlarms(true);
|
||||
} else
|
||||
iv->resetAlarms();
|
||||
iv->doCalculations();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue