Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/app_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ void config_changed(String name)
timeManager.setTimeZone(time_zone);
} else if(name == "flags") {
divert.setMode((config_divert_enabled() && 1 == config_charge_mode()) ? DivertMode::Eco : DivertMode::Normal);
if(mqtt_connected() != config_mqtt_enabled()) {
mqtt_restart();
if(mqtt.isConnected() != config_mqtt_enabled()) {
mqtt.restartConnection();
}
if(emoncms_connected != config_emoncms_enabled()) {
emoncms_updated = true;
Expand All @@ -364,7 +364,7 @@ void config_changed(String name)
OcppTask::notifyConfigChanged();
evse.setSleepForDisable(!config_pause_uses_disabled());
} else if(name.startsWith("mqtt_")) {
mqtt_restart();
mqtt.restartConnection();
} else if(name.startsWith("ocpp_")) {
OcppTask::notifyConfigChanged();
} else if(name.startsWith("emoncms_")) {
Expand Down
1 change: 0 additions & 1 deletion src/app_config_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <ConfigOpt.h>
#include <ConfigOptDefinition.h>

#include "mqtt.h"
#include "app_config.h"

class ConfigOptVirtualChargeMode : public ConfigOpt
Expand Down
1 change: 0 additions & 1 deletion src/app_config_mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <ConfigOpt.h>
#include <ConfigOptDefinition.h>

#include "mqtt.h"
#include "app_config.h"

class ConfigOptVirtualMqttProtocol : public ConfigOpt
Expand Down
1 change: 0 additions & 1 deletion src/current_shaper.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "emonesp.h"
#include <MicroTasks.h>
#include "evse_man.h"
#include "mqtt.h"
#include "app_config.h"
#include "http_update.h"
#include "input.h"
Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ void setup()

input_setup();

mqtt.begin();

ocpp.begin(evse, lcd, eventLog, rfid);
DBUGF("After ocpp.begin: %d", ESPAL.getFreeHeap());

Expand Down Expand Up @@ -237,8 +239,6 @@ loop() {
teslaClient.loop();
}

mqtt_loop();

// -------------------------------------------------------------------
// Do these things once every 30 seconds
// -------------------------------------------------------------------
Expand Down Expand Up @@ -300,7 +300,7 @@ void event_send(JsonDocument &event)
#endif
web_server_event(event);
yield();
mqtt_publish(event);
mqtt.publishData(event);
yield();
}

Expand Down
Loading
Loading