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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user