mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-02-15 04:17:29 +00:00
Merge branch 'master' into dev-v2.1.0
This commit is contained in:
@@ -18,7 +18,7 @@ ADC_MODE(ADC_VCC);
|
||||
#if defined(ESP32)
|
||||
#include <esp_task_wdt.h>
|
||||
#endif
|
||||
#define WDT_TIMEOUT 10
|
||||
#define WDT_TIMEOUT 30
|
||||
|
||||
#include "AmsToMqttBridge.h"
|
||||
#include "AmsStorage.h"
|
||||
@@ -139,12 +139,14 @@ void setup() {
|
||||
hw.ledBlink(LED_GREEN, 1);
|
||||
hw.ledBlink(LED_BLUE, 1);
|
||||
|
||||
#if defined(ESP32)
|
||||
EntsoeConfig entsoe;
|
||||
if(config.getEntsoeConfig(entsoe) && strlen(entsoe.token) > 0) {
|
||||
eapi = new EntsoeApi(&Debug);
|
||||
eapi->setup(entsoe);
|
||||
ws.setEntsoeApi(eapi);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool shared = false;
|
||||
config.getMeterConfig(meterConfig);
|
||||
@@ -439,6 +441,7 @@ void loop() {
|
||||
mqtt->disconnect();
|
||||
}
|
||||
|
||||
#if defined(ESP32)
|
||||
if(eapi != NULL && ntpEnabled) {
|
||||
if(eapi->loop() && mqtt != NULL && mqttHandler != NULL && mqtt->connected()) {
|
||||
mqttHandler->publishPrices(eapi);
|
||||
@@ -456,10 +459,11 @@ void loop() {
|
||||
} else if(eapi != NULL) {
|
||||
delete eapi;
|
||||
eapi = NULL;
|
||||
ws.setEntsoeApi(eapi);
|
||||
ws.setEntsoeApi(NULL);
|
||||
}
|
||||
config.ackEntsoeChange();
|
||||
}
|
||||
#endif
|
||||
ws.loop();
|
||||
}
|
||||
if(mqtt != NULL) { // Run loop regardless, to let MQTT do its work.
|
||||
|
||||
Reference in New Issue
Block a user