module LocalUpdate, GyverLamp, WebSocket for C6

This commit is contained in:
Mit4el
2024-12-17 21:09:22 +03:00
parent 5e801e7789
commit a844d08ebf
18 changed files with 4199 additions and 33 deletions

View 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;
}
}

View 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*": []
}
}