Fixed ESP8266 build issue

This commit is contained in:
Gunnar Skjold
2024-04-13 11:38:03 +02:00
parent 8c8e14f60c
commit c74e719327
2 changed files with 8 additions and 0 deletions

View File

@@ -1652,7 +1652,11 @@ void AmsWebServer::upgradeFromUrl(String url, String nextVersion) {
httpUpdate.rebootOnUpdate(false);
httpUpdate.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
#if defined(ESP32)
HTTPUpdateResult ret = httpUpdate.update(client, url, currentVersion, std::bind(&AmsWebServer::updaterRequestCallback, this, std::placeholders::_1));
#else
HTTPUpdateResult ret = httpUpdate.update(client, url, currentVersion);
#endif
int lastError = httpUpdate.getLastError();
config->setUpgradeInformation(ret, ret == HTTP_UPDATE_OK ? 0 : lastError, FirmwareVersion::VersionString, nextVersion.c_str());

View File

@@ -916,9 +916,11 @@ void handleEnergyAccountingChanged() {
config.getEnergyAccountingConfig(*eac);
ea.setup(&ds, eac);
config.ackEnergyAccountingChange();
#if defined(ESP32)
if(cloud != NULL) {
cloud->setEnergyAccountingConfig(*eac);
}
#endif
}
char ntpServerName[64] = "";
@@ -1055,9 +1057,11 @@ void handlePriceService(unsigned long now) {
ps = new PriceService(&Debug);
ea.setPriceService(ps);
ws.setPriceService(ps);
#if defined(ESP32)
if(cloud != NULL) {
cloud->setPriceConfig(price);
}
#endif
}
ps->setup(price);
} else if(ps != NULL) {