mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 22:52:19 +03:00
module LocalUpdate, GyverLamp, WebSocket for C6
This commit is contained in:
27
src/modules/virtual/UpdateServer/UpdateServer.cpp
Normal file
27
src/modules/virtual/UpdateServer/UpdateServer.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "Global.h"
|
||||
#include "classes/IoTItem.h"
|
||||
|
||||
class UpdateServer : public IoTItem {
|
||||
public:
|
||||
UpdateServer(String parameters) : IoTItem(parameters) {}
|
||||
|
||||
void onModuleOrder(String &key, String &value) {
|
||||
if (key == "startUpdateAll") {
|
||||
upgrade_firmware(3, value);
|
||||
} else if (key == "startUpdateFS") {
|
||||
upgrade_firmware(2, value);
|
||||
} else if (key == "startUpdateFW") {
|
||||
upgrade_firmware(1, value);
|
||||
}
|
||||
}
|
||||
|
||||
~UpdateServer() {};
|
||||
};
|
||||
|
||||
void* getAPI_UpdateServer(String subtype, String param) {
|
||||
if (subtype == F("UpdateServer")) {
|
||||
return new UpdateServer(param);
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
41
src/modules/virtual/UpdateServer/modinfo.json
Normal file
41
src/modules/virtual/UpdateServer/modinfo.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"menuSection": "virtual_elments",
|
||||
"configItem": [
|
||||
{
|
||||
"global": 0,
|
||||
"name": "Свой сервер обновлений",
|
||||
"type": "Reading",
|
||||
"subtype": "UpdateServer",
|
||||
"id": "UpdateServer",
|
||||
"widget": "",
|
||||
"page": "",
|
||||
"descr": "",
|
||||
"btn-startUpdateAll": "http://192.168.11.112/iotm/esp8266_4mb/400",
|
||||
"btn-startUpdateFS": "http://192.168.11.112/iotm/esp8266_4mb/400",
|
||||
"btn-startUpdateFW": "http://192.168.11.112/iotm/esp8266_4mb/400"
|
||||
}
|
||||
],
|
||||
"about": {
|
||||
"authorName": "Ilya Belyakov",
|
||||
"authorContact": "https://t.me/Biveraxe",
|
||||
"authorGit": "https://github.com/biveraxe",
|
||||
"exampleURL": "https://iotmanager.org/",
|
||||
"specialThanks": "",
|
||||
"moduleName": "UpdateServer",
|
||||
"moduleVersion": "1.0",
|
||||
"usedRam": {
|
||||
"esp32_4mb": 15,
|
||||
"esp8266_4mb": 15
|
||||
},
|
||||
"title": "Свой сервер обновлений",
|
||||
"moduleDesc": "Модуль для получения прошивки из своего сервера обновлений.",
|
||||
"propInfo": {
|
||||
"btn-startUpdate": "Кнопка запуска процесса обновления из указанного URL"
|
||||
}
|
||||
},
|
||||
"defActive": true,
|
||||
"usedLibs": {
|
||||
"esp32*": [],
|
||||
"esp82*": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user