Changes for cloud

This commit is contained in:
Gunnar Skjold
2024-04-06 11:34:04 +02:00
parent 4884d3a0e2
commit 29c8011cda
11 changed files with 229 additions and 151 deletions

View File

@@ -674,7 +674,7 @@ void loop() {
if(cloud == NULL) {
cloud = new CloudConnector(&Debug);
}
if(cloud->setup(cc, meterConfig, &hw)) {
if(cloud->setup(cc, meterConfig, sysConfig, &hw, &rdc)) {
config.setCloudConfig(cc);
}
}
@@ -929,6 +929,11 @@ void handleNtpChange() {
ws.setTimezone(tz);
ds.setTimezone(tz);
ea.setTimezone(tz);
#if defined(ESP32)
if(cloud != NULL) {
cloud->setTimezone(tz);
}
#endif
}
config.ackNtpChange();
@@ -1149,6 +1154,10 @@ void connectToNetwork() {
}
ch->connect(network, sysConfig);
ws.setConnectionHandler(ch);
#if defined(ESP32)
if(cloud != NULL)
cloud->setConnectionHandler(ch);
#endif
} else {
setupMode = false;
toggleSetupMode();