Include device information when asking for new version (#1052)

This commit is contained in:
Gunnar Skjold 2025-10-30 15:54:57 +01:00 committed by GitHub
parent 19ff70782f
commit 1a5b9542f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -230,6 +230,16 @@ bool AmsFirmwareUpdater::fetchNextVersion() {
http.setUserAgent("AMS-Firmware-Updater"); http.setUserAgent("AMS-Firmware-Updater");
http.addHeader(F("Cache-Control"), "no-cache"); http.addHeader(F("Cache-Control"), "no-cache");
http.addHeader(F("x-AMS-version"), FirmwareVersion::VersionString); http.addHeader(F("x-AMS-version"), FirmwareVersion::VersionString);
http.addHeader(F("x-AMS-STA-MAC"), WiFi.macAddress());
http.addHeader(F("x-AMS-AP-MAC"), WiFi.softAPmacAddress());
http.addHeader(F("x-AMS-chip-size"), String(ESP.getFlashChipSize()));
http.addHeader(F("x-AMS-board-type"), String(hw->getBoardType(), 10));
if(meterState->getMeterType() != AmsTypeAutodetect) {
http.addHeader(F("x-AMS-meter-mfg"), String(meterState->getMeterType(), 10));
}
if(!meterState->getMeterModel().isEmpty()) {
http.addHeader(F("x-AMS-meter-model"), meterState->getMeterModel());
}
int status = http.GET(); int status = http.GET();
if(status == 204) { if(status == 204) {
String nextVersion = http.header("x-version"); String nextVersion = http.header("x-version");