Skip to content

Commit

Permalink
Fixed ESP8266 build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gskjold committed Apr 13, 2024
1 parent 8c8e14f commit c74e719
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/SvelteUi/src/AmsWebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 4 additions & 0 deletions src/AmsToMqttBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] = "";
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c74e719

Please sign in to comment.