fix many bugs

This commit is contained in:
Dmitry Borisenko
2020-03-22 22:41:52 +01:00
parent 9a775cd9d4
commit b799a48c8a
15 changed files with 99 additions and 131 deletions

View File

@@ -38,7 +38,8 @@ void MQTT_init() {
jsonWrite(configSetup, "mqttPass", request->getParam("mqttPass")->value());
}
saveConfig();
start_connection = true;
start_connecting_to_mqtt = true;
request->send(200, "text/text", "ok");
});
@@ -51,8 +52,8 @@ void MQTT_init() {
}
void handle_connection() {
if (start_connection) {
start_connection = false;
if (start_connecting_to_mqtt) {
start_connecting_to_mqtt = false;
client.disconnect();
MQTT_Connecting();
}