Update usage report to send hasPSRAM and psramSize fields

- Modified reportUpgradeEvent in index.js to use new hasPSRAM and psramSize fields
- Changed from calculating psramSize from free PSRAM to using total PSRAM size from /info endpoint
- Both fields now correctly sent in upgrade usage reports to usage.wled.me

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-08 19:01:17 +00:00
parent 2a53f415ea
commit 4684e092a8

View File

@@ -3443,7 +3443,8 @@ function reportUpgradeEvent(info, oldVersion) {
};
// Add optional fields if available
if (infoData.psram !== undefined) upgradeData.psramSize = Math.round(infoData.psram / (1024 * 1024)); // convert bytes to MB
if (infoData.hasPSRAM !== undefined) upgradeData.hasPSRAM = infoData.hasPSRAM; // Whether device has PSRAM
if (infoData.psramSize !== undefined) upgradeData.psramSize = infoData.psramSize; // Total PSRAM size in MB
// Note: partitionSizes not currently available in /json/info endpoint
// Make AJAX call to postUpgradeEvent API