Добавляем альтернативный источник обновлений

This commit is contained in:
2024-08-14 00:00:52 +05:00
parent edd498d1c9
commit 6a288bb002
2 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#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 == "startUpdate") {
upgrade_firmware(3, 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,39 @@
{
"menuSection": "virtual_elments",
"configItem": [
{
"global": 0,
"name": "Свой сервер обновлений",
"type": "Reading",
"subtype": "UpdateServer",
"id": "UpdateServer",
"widget": "",
"page": "",
"descr": "",
"btn-startUpdate": "http://192.168.11.112/iotm"
}
],
"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*": []
}
}