From 8aad1ba87d0731d3325128c421ebebc1a5cef210 Mon Sep 17 00:00:00 2001 From: biver Date: Sat, 1 Oct 2022 10:11:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D0=BC=20=D0=B2=20=D1=82=D0=B0=D0=B9=D0=BC=D0=B5=D1=80=20?= =?UTF-8?q?=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D1=83=20=D0=BD?= =?UTF-8?q?=D0=B0=D1=87=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B7?= =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=87=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B7=20=D1=81=D1=86=D0=B5=D0=BD=D0=B0=D1=80=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/virtual/Timer/Timer.cpp | 6 +++++- src/modules/virtual/Timer/modinfo.json | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/virtual/Timer/Timer.cpp b/src/modules/virtual/Timer/Timer.cpp index aad43c5e..e5cc7039 100644 --- a/src/modules/virtual/Timer/Timer.cpp +++ b/src/modules/virtual/Timer/Timer.cpp @@ -49,9 +49,13 @@ class Timer : public IoTItem { } else if (command == "continue") { _pause = false; } else if (command == "int") { - if (param.size()) { + if (param.size() == 1) { setInterval(param[0].valD); } + } else if (command == "setInitCountDown") { + if (param.size() == 1) { + _initValue = param[0].valD; + } } return {}; diff --git a/src/modules/virtual/Timer/modinfo.json b/src/modules/virtual/Timer/modinfo.json index f32e2cab..9864fd3b 100644 --- a/src/modules/virtual/Timer/modinfo.json +++ b/src/modules/virtual/Timer/modinfo.json @@ -55,6 +55,11 @@ "name": "int", "descr": "Можно изменить шаг тиков.", "params": ["Число в секундах"] + }, + { + "name": "setInitCountDown", + "descr": "Меняем начальное значение счетчика, устанавливаемое после сброса.", + "params": ["Число в секундах"] } ] },