upgrad esp mqtt lib

This commit is contained in:
technyon
2023-02-26 23:04:21 +01:00
parent b14ea6326e
commit aa224e8c7d
24 changed files with 219 additions and 229 deletions

View File

@@ -25,7 +25,7 @@ WifiDevice::WifiDevice(const String& hostname, Preferences* _preferences)
{
Log->println(F("MQTT over TLS."));
Log->println(_ca);
_mqttClientSecure = new espMqttClientWifiSecure();
_mqttClientSecure = new espMqttClientSecure();
_mqttClientSecure->setCACert(_ca);
if(crtLength > 1 && keyLength > 1) // length is 1 when empty
{
@@ -38,7 +38,7 @@ WifiDevice::WifiDevice(const String& hostname, Preferences* _preferences)
} else
{
Log->println(F("MQTT without TLS."));
_mqttClient = new espMqttClientWifi();
_mqttClient = new espMqttClient();
}
if(_preferences->getBool(preference_mqtt_log_enabled))
@@ -144,11 +144,11 @@ void WifiDevice::update()
{
if(_useEncryption)
{
_mqttClientSecure->update();
_mqttClientSecure->loop();
}
else
{
_mqttClient->update();
_mqttClient->loop();
}
}