Add support for resetting counters on tele_period

Add support for resetting counters on tele_period if SetOption78 is enabled.
This commit is contained in:
Andre Thomas 2019-12-28 16:49:57 +02:00 committed by GitHub
parent aefb3fb9de
commit 436cf830b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -150,6 +150,9 @@ void CounterShow(bool json)
ResponseAppend_P(PSTR(",\"COUNTER\":{"));
}
ResponseAppend_P(PSTR("%s\"C%d\":%s"), (header)?",":"", i +1, counter);
if ((0 == tele_period ) && (Settings.flag3.counter_reset_on_tele)) {
RtcSettings.pulse_counter[i] = 0;
}
header = true;
#ifdef USE_DOMOTICZ
if ((0 == tele_period) && (1 == dsxflg)) {