добавление кнопок в элемент

This commit is contained in:
Dmitry Borisenko
2022-12-14 00:56:25 +01:00
parent d2a615c9e5
commit 2db14ed21a
9 changed files with 67 additions and 36 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -4,12 +4,12 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>IoT Manager 4.4.3</title>
<title>IoT Manager 4.4.4</title>
<link rel="icon" type="image/png" href="/favicon.ico" />
<link rel="stylesheet" href="/build/bundle.css?443" />
<link rel="stylesheet" href="/build/bundle.css?444" />
<script defer src="/build/bundle.js?443"></script>
<script defer src="/build/bundle.js?444"></script>
</head>
<body></body>

View File

@@ -62,7 +62,9 @@
"logid": "t",
"points": 365,
"telegram": 0,
"test": 0
"test": 0,
"btn-defvalue": 0,
"btn-reset": "nil"
},
{
"global": 0,

View File

@@ -55,6 +55,7 @@ class IoTItem {
virtual void onRegEvent(IoTItem* item);
virtual void onMqttRecive(String& topic, String& msg);
virtual void onMqttWsAppConnectEvent();
virtual void onModuleOrder(String& key, String& value);
// делаем доступным модулям отправку сообщений в телеграм
virtual void sendTelegramMsg(bool often, String msg);

View File

@@ -227,6 +227,24 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
standWebSocket.sendTXT(num, "/tstr|");
}
// получаем команду посланную из модуля
if (headerStr == "/order|") {
SerialPrint("i", F("=>WS"), "Msg from module");
String json;
writeUint8tToString(payload, length, headerLenth, json);
String id, key, value;
jsonRead(json, "id", id);
jsonRead(json, "key", key);
jsonRead(json, "value", value);
for (std::list<IoTItem*>::iterator it = IoTItems.begin(); it != IoTItems.end(); ++it) {
if ((*it)->getID() == id) {
(*it)->onModuleOrder(key, value);
}
}
}
} break;
case WStype_BIN: {

View File

@@ -178,6 +178,7 @@ void IoTItem::checkIntFromNet() {
void IoTItem::onRegEvent(IoTItem* item) {}
void IoTItem::onMqttRecive(String& topic, String& msg) {}
void IoTItem::onMqttWsAppConnectEvent() {}
void IoTItem::onModuleOrder(String& key, String& value) {}
// делаем доступным модулям отправку сообщений в телеграм
void IoTItem::sendTelegramMsg(bool often, String msg) {}

View File

@@ -240,6 +240,13 @@ class LogingDaily : public IoTItem {
int calculateMaxCount() {
return 86400;
}
void onModuleOrder(String &key, String &value) {
if (key == "defvalue") {
} else if (key == "reset") {
}
SerialPrint("i", F("LogingDaily"), "key " + key + ", value " + value);
}
};
void *getAPI_LogingDaily(String subtype, String param) {

View File

@@ -15,7 +15,9 @@
"logid": "t",
"points": 365,
"telegram": 0,
"test": 0
"test": 0,
"btn-defvalue": 0,
"btn-reset": "nil"
}
],
"about": {