Updated cloud connector

This commit is contained in:
Gunnar Skjold
2024-01-06 09:52:35 +01:00
parent 460238e99d
commit 6012c19fc4
10 changed files with 185 additions and 83 deletions

View File

@@ -623,23 +623,25 @@ void loop() {
if(end - start > 1000) {
debugW_P(PSTR("Used %dms to handle mqtt"), millis()-start);
}
#if defined(ESP32)
if(config.isCloudChanged()) {
CloudConfig cc;
if(config.getCloudConfig(cc) && cc.enabled) {
if(cloud == NULL) {
cloud = new CloudConnector(&Debug);
}
cloud->setup(cc, &hw);
}
config.ackCloudConfig();
}
if(cloud != NULL) {
cloud->update(meterState, ea);
}
#endif
}
#if defined(ESP32)
if(config.isCloudChanged()) {
CloudConfig cc;
if(config.getCloudConfig(cc) && cc.enabled) {
if(cloud == NULL) {
cloud = new CloudConnector(&Debug);
}
if(cloud->setup(cc, meterConfig, &hw)) {
config.setCloudConfig(cc);
}
}
config.ackCloudConfig();
}
if(cloud != NULL) {
cloud->update(meterState, ea);
}
#endif
/*
if(now - lastVoltageCheck > 500) {
handleVoltageCheck();