fixes for OTA

This commit is contained in:
technyon
2023-03-04 13:51:26 +01:00
parent befb0f8851
commit 82f8e91036
16 changed files with 99 additions and 14 deletions

View File

@@ -130,13 +130,15 @@ ReconnectStatus EthLan8720Device::reconnect()
void EthLan8720Device::update()
{
if(_useEncryption)
if(_mqttEnabled)
{
_mqttClientSecure->loop();
}
else
{
_mqttClient->loop();
if (_useEncryption)
{
_mqttClientSecure->loop();
} else
{
_mqttClient->loop();
}
}
}
@@ -310,3 +312,16 @@ uint16_t EthLan8720Device::mqttSubscribe(const char *topic, uint8_t qos)
return _mqttClient->subscribe(topic, qos);
}
}
void EthLan8720Device::disableMqtt()
{
if (_useEncryption)
{
_mqttClientSecure->disconnect();
} else
{
_mqttClient->disconnect();
}
_mqttEnabled = false;
}