update mqttClient, works with tasmota-arduino 2.14 / 3.0 without WiFiSecure

This commit is contained in:
MichaelDvP
2023-12-19 13:47:10 +01:00
parent 9f3e2dbcd3
commit 446601c6e0
6 changed files with 172 additions and 8 deletions

View File

@@ -218,8 +218,10 @@ bool MqttSettingsService::configureMqtt() {
void MqttSettings::read(MqttSettings & settings, JsonObject & root) {
#if CONFIG_IDF_TARGET_ESP32S3
#ifndef TASMOTA_SDK
root["enableTLS"] = settings.enableTLS;
root["rootCA"] = settings.rootCA;
#endif
#endif
root["enabled"] = settings.enabled;
root["host"] = settings.host;
@@ -255,8 +257,10 @@ StateUpdateResult MqttSettings::update(JsonObject & root, MqttSettings & setting
bool changed = false;
#if CONFIG_IDF_TARGET_ESP32S3
#ifndef TASMOTA_SDK
newSettings.enableTLS = root["enableTLS"] | false;
newSettings.rootCA = root["rootCA"] | "";
#endif
#endif
newSettings.enabled = root["enabled"] | FACTORY_MQTT_ENABLED;
newSettings.host = root["host"] | FACTORY_MQTT_HOST;