mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-28 07:02:17 +03:00
Добавляем переменным возможность хранить время по шаблону
This commit is contained in:
@@ -1,15 +1,29 @@
|
||||
#include "Global.h"
|
||||
#include "classes/IoTItem.h"
|
||||
#include "classes/IoTRTC.h"
|
||||
|
||||
extern IoTRTC *watch;
|
||||
|
||||
class Variable : public IoTItem {
|
||||
private:
|
||||
String _dtFormat;
|
||||
public:
|
||||
Variable(String parameters): IoTItem(parameters) { }
|
||||
Variable(String parameters): IoTItem(parameters) {
|
||||
jsonRead(parameters, "dtFormat", _dtFormat);
|
||||
_dtFormat = _dtFormat;
|
||||
}
|
||||
|
||||
// особенность данного модуля - просто хранение значения для сценария, нет событий
|
||||
// void setValue(IoTValue Value) {
|
||||
// value = Value;
|
||||
// }
|
||||
|
||||
void doByInterval() {
|
||||
if (_dtFormat != "") {
|
||||
value.isDecimal = false;
|
||||
value.valS = watch->gettime(_dtFormat + " ");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void* getAPI_Variable(String subtype, String param) {
|
||||
|
||||
Reference in New Issue
Block a user