Merge pull request #13442 from hallard/fix_mqtt_tls_webui

Fixed Checkbox "MQTT TLS" are not saved through webinterface
This commit is contained in:
Theo Arends 2021-10-23 14:25:00 +02:00 committed by GitHub
commit e4570cd45f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1883,7 +1883,7 @@ void HandleMqttConfiguration(void)
SettingsText(SET_MQTT_HOST), SettingsText(SET_MQTT_HOST),
Settings->mqtt_port, Settings->mqtt_port,
#ifdef USE_MQTT_TLS #ifdef USE_MQTT_TLS
Mqtt.mqtt_tls ? PSTR(" checked") : "", // SetOption102 - Enable MQTT TLS Mqtt.mqtt_tls ? PSTR(" checked") : "", // SetOption103 - Enable MQTT TLS
#endif // USE_MQTT_TLS #endif // USE_MQTT_TLS
Format(str, PSTR(MQTT_CLIENT_ID), sizeof(str)), PSTR(MQTT_CLIENT_ID), SettingsText(SET_MQTT_CLIENT)); Format(str, PSTR(MQTT_CLIENT_ID), sizeof(str)), PSTR(MQTT_CLIENT_ID), SettingsText(SET_MQTT_CLIENT));
WSContentSend_P(HTTP_FORM_MQTT2, WSContentSend_P(HTTP_FORM_MQTT2,
@ -1905,8 +1905,8 @@ void MqttSaveSettings(void) {
cmnd += AddWebCommand(PSTR(D_CMND_TOPIC), PSTR("mt"), PSTR("1")); cmnd += AddWebCommand(PSTR(D_CMND_TOPIC), PSTR("mt"), PSTR("1"));
cmnd += AddWebCommand(PSTR(D_CMND_FULLTOPIC), PSTR("mf"), PSTR("1")); cmnd += AddWebCommand(PSTR(D_CMND_FULLTOPIC), PSTR("mf"), PSTR("1"));
#ifdef USE_MQTT_TLS #ifdef USE_MQTT_TLS
cmnd += F(";" D_CMND_SO "102 "); cmnd += F(";" D_CMND_SO "103 ");
cmnd += Webserver->hasArg(F("b3")); // SetOption102 - Enable MQTT TLS cmnd += Webserver->hasArg(F("b3")); // SetOption103 - Enable MQTT TLS
#endif #endif
ExecuteWebCommand((char*)cmnd.c_str()); ExecuteWebCommand((char*)cmnd.c_str());
} }