mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 09:19:51 +03:00
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into dev
This commit is contained in:
@@ -167,7 +167,7 @@ void MqttSettingsService::WiFiEvent(WiFiEvent_t event) {
|
||||
bool MqttSettingsService::configureMqtt() {
|
||||
// disconnect if already connected
|
||||
if (_mqttClient->connected()) {
|
||||
emsesp::EMSESP::logger().info("Disconnecting to configure");
|
||||
// emsesp::EMSESP::logger().info("Disconnecting to configure");
|
||||
_mqttClient->disconnect(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -321,8 +321,12 @@ void Mqtt::on_publish(uint16_t packetId) const {
|
||||
LOG_DEBUG("Packet %d sent successful", packetId);
|
||||
}
|
||||
|
||||
// called when MQTT settings have changed via the Web forms
|
||||
// called when MQTT settings have changed via the MQTT Settings or Application Settings Web pages
|
||||
void Mqtt::reset_mqtt() {
|
||||
if (!enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mqttClient_) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -195,6 +195,9 @@ void WebStatusService::action(AsyncWebServerRequest * request, JsonVariant json)
|
||||
ok = uploadURL(param.c_str());
|
||||
} else if (action == "systemStatus" && is_admin) {
|
||||
ok = setSystemStatus(param.c_str());
|
||||
} else if (action == "resetMQTT" && is_admin) {
|
||||
emsesp::EMSESP::mqtt_.reset_mqtt();
|
||||
ok = true;
|
||||
}
|
||||
|
||||
#if defined(EMSESP_STANDALONE) && !defined(EMSESP_UNITY)
|
||||
|
||||
Reference in New Issue
Block a user