diff --git a/src/modules/exec/Timer/Timer.cpp b/src/modules/exec/Timer/Timer.cpp index 63fa66fd..269c8023 100644 --- a/src/modules/exec/Timer/Timer.cpp +++ b/src/modules/exec/Timer/Timer.cpp @@ -9,6 +9,7 @@ class Timer : public IoTItem { bool _unfin = false; bool _ticker = false; bool _repeat = false; + bool _needSave = false; public: Timer(String parameters): IoTItem(parameters) { @@ -19,12 +20,13 @@ class Timer : public IoTItem { jsonRead(parameters, "repeat", _repeat); if (_repeat) _repeat = valDtmp; // если в параметрах просят повторить, то запоминаем настроечное значение отчета _unfin = !value.valD; + jsonRead(parameters, "needSave", _needSave); // нужно сохранять счетчик в постоянную память } void doByInterval() { if (!_unfin && value.valD) { value.valD--; - needSave = true; + if (_needSave) needSave = true; if (value.valD == 0) { regEvent(value.valD, "Time's up"); if (_repeat) value.valD = _repeat; diff --git a/src/modules/exec/Timer/items.json b/src/modules/exec/Timer/items.json index 821676a5..22445f36 100644 --- a/src/modules/exec/Timer/items.json +++ b/src/modules/exec/Timer/items.json @@ -12,6 +12,7 @@ "int": 1, "countDown": 15, "ticker": 0, - "repeat": 0 + "repeat": 0, + "needSave": 0 } ] \ No newline at end of file