mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-24 14:26:11 +02:00
Merge branch 'development03' into eth
This commit is contained in:
commit
0be01a91a1
23 changed files with 876 additions and 412 deletions
21
src/app.cpp
21
src/app.cpp
|
@ -325,6 +325,7 @@ void app::tickComm(void) {
|
|||
//-----------------------------------------------------------------------------
|
||||
void app::tickZeroValues(void) {
|
||||
Inverter<> *iv;
|
||||
bool changed = false;
|
||||
// set values to zero, except yields
|
||||
for (uint8_t id = 0; id < mSys.getNumInverters(); id++) {
|
||||
iv = mSys.getInverterByPos(id);
|
||||
|
@ -332,7 +333,11 @@ void app::tickZeroValues(void) {
|
|||
continue; // skip to next inverter
|
||||
|
||||
mPayload.zeroInverterValues(iv);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if(changed)
|
||||
payloadEventListener(RealTimeRunData_Debug);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -340,15 +345,21 @@ void app::tickMinute(void) {
|
|||
// only triggered if 'reset values on no avail is enabled'
|
||||
|
||||
Inverter<> *iv;
|
||||
bool changed = false;
|
||||
// set values to zero, except yields
|
||||
for (uint8_t id = 0; id < mSys.getNumInverters(); id++) {
|
||||
iv = mSys.getInverterByPos(id);
|
||||
if (NULL == iv)
|
||||
continue; // skip to next inverter
|
||||
|
||||
if (!iv->isAvailable(mTimestamp) && !iv->isProducing(mTimestamp) && iv->config->enabled)
|
||||
if (!iv->isAvailable(mTimestamp) && !iv->isProducing(mTimestamp) && iv->config->enabled) {
|
||||
mPayload.zeroInverterValues(iv);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(changed)
|
||||
payloadEventListener(RealTimeRunData_Debug);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -359,16 +370,20 @@ void app::tickMidnight(void) {
|
|||
onceAt(std::bind(&app::tickMidnight, this), nxtTrig, "mid2");
|
||||
|
||||
Inverter<> *iv;
|
||||
bool changed = false;
|
||||
// set values to zero, except yield total
|
||||
for (uint8_t id = 0; id < mSys.getNumInverters(); id++) {
|
||||
iv = mSys.getInverterByPos(id);
|
||||
if (NULL == iv)
|
||||
continue; // skip to next inverter
|
||||
|
||||
mPayload.zeroInverterValues(iv);
|
||||
mPayload.zeroYieldDay(iv);
|
||||
mPayload.zeroInverterValues(iv, false);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if(changed)
|
||||
payloadEventListener(RealTimeRunData_Debug);
|
||||
|
||||
if (mMqttEnabled)
|
||||
mMqtt.tickerMidnight();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue