mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-28 15:12:19 +03:00
Меняем структуру FS для хранения модулей и добавляем скрипт сборки модулей для интеграции в меню и библиотеки
This commit is contained in:
21
src/modules/system/Variable/Variable.cpp
Normal file
21
src/modules/system/Variable/Variable.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "Global.h"
|
||||
#include "classes/IoTItem.h"
|
||||
|
||||
|
||||
class Variable : public IoTItem {
|
||||
public:
|
||||
Variable(String parameters): IoTItem(parameters) { }
|
||||
|
||||
// особенность данного модуля - просто хранение значения для сценария, нет событий
|
||||
// void setValue(IoTValue Value) {
|
||||
// value = Value;
|
||||
// }
|
||||
};
|
||||
|
||||
void* getAPI_Variable(String subtype, String param) {
|
||||
if (subtype == F("Variable")) {
|
||||
return new Variable(param);
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
15
src/modules/system/Variable/items.json
Normal file
15
src/modules/system/Variable/items.json
Normal file
@@ -0,0 +1,15 @@
|
||||
[
|
||||
{
|
||||
"name": "Переменная",
|
||||
"num": 30,
|
||||
"type": "Reading",
|
||||
"subtype": "Variable",
|
||||
"id": "var",
|
||||
"widget": "",
|
||||
"page": "",
|
||||
"descr": "",
|
||||
|
||||
"int": "0",
|
||||
"val": "0"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user