mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
268 Single Scenario changed to MQTT source
This commit is contained in:
28
src/Web.cpp
28
src/Web.cpp
@@ -61,16 +61,32 @@ void web_init() {
|
||||
request->send(200);
|
||||
}
|
||||
|
||||
if (request->hasArg("onescen")) {
|
||||
bool value = request->getParam("onescen")->value().toInt();
|
||||
jsonWriteBool(configSetupJson, "onescen", value);
|
||||
//if (request->hasArg("snaUdp")) {
|
||||
// bool value = request->getParam("snaUdp")->value().toInt();
|
||||
// jsonWriteBool(configSetupJson, "snaUdp", value);
|
||||
// saveConfig();
|
||||
// #ifdef UDP_ENABLED
|
||||
// asyncUdpInit();
|
||||
// #endif
|
||||
// request->send(200);
|
||||
//}
|
||||
|
||||
//if (request->hasArg("scenUdp")) {
|
||||
// myNotAsyncActions->make(do_sendScenUDP);
|
||||
// request->send(200);
|
||||
//}
|
||||
|
||||
if (request->hasArg("snaMqtt")) {
|
||||
bool value = request->getParam("snaMqtt")->value().toInt();
|
||||
jsonWriteBool(configSetupJson, "snaMqtt", value);
|
||||
saveConfig();
|
||||
asyncUdpInit();
|
||||
mqtt.subscribe((mqttPrefix + "/+/+/status").c_str());
|
||||
mqtt.subscribe((mqttPrefix + "/+/+/info").c_str());
|
||||
request->send(200);
|
||||
}
|
||||
|
||||
if (request->hasArg("scenudp")) {
|
||||
myNotAsyncActions->make(do_sendScenUDP);
|
||||
if (request->hasArg("scenMqtt")) {
|
||||
myNotAsyncActions->make(do_sendScenMQTT);
|
||||
request->send(200);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user