Import/Export config over MQTT

This commit is contained in:
iranl
2025-01-31 20:21:26 +01:00
parent 57456f42f9
commit 24bbe22e87
25 changed files with 1792 additions and 1206 deletions

View File

@@ -32,7 +32,7 @@ void NetworkDevice::init()
if(ca_cert.length() > 1)
{
_useEncryption = true;
Log->println(("MQTT over TLS."));
Log->println("MQTT over TLS.");
_mqttClientSecure = new espMqttClientSecure(espMqttClientTypes::UseInternalTask::NO);
_mqttClientSecure->setCACert(caDest);
@@ -57,7 +57,7 @@ void NetworkDevice::init()
if(cert.length() > 1 && key.length() > 1)
{
Log->println(("MQTT with client certificate."));
Log->println("MQTT with client certificate.");
_mqttClientSecure->setCertificate(certDest);
_mqttClientSecure->setPrivateKey(keyDest);
}
@@ -69,7 +69,7 @@ void NetworkDevice::init()
if (!_useEncryption)
{
Log->println(("MQTT without TLS."));
Log->println("MQTT without TLS.");
_mqttClient = new espMqttClient(espMqttClientTypes::UseInternalTask::NO);
}
@@ -251,6 +251,11 @@ void NetworkDevice::mqttDisable()
_mqttEnabled = false;
}
bool NetworkDevice::isEncrypted()
{
return _useEncryption;
}
MqttClient *NetworkDevice::getMqttClient() const
{
if (_useEncryption)