diff --git a/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp b/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp index de76fc79f..637c5d25e 100644 --- a/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp +++ b/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp @@ -138,6 +138,15 @@ void WipperSnapper_LittleFS::parseSecrets() { "credentials!\n"); } + if (doc["status_pixel_brightness"]) { + // check it casts to float and support user specifying 0.0f which is + // default, by using the |operator instead of .as + // https://arduinojson.org/v7/api/jsonvariant/or/ + if ((doc["status_pixel_brightness"] | -1.0f) != -1.0f) { + WS.status_pixel_brightness = doc["status_pixel_brightness"].as(); + } + } + // Close the file secretsFile.close(); diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index e4fa0ee72..495fae4d4 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -452,6 +452,14 @@ void Wippersnapper_FS::parseSecrets() { "credentials!"); } + if (doc["status_pixel_brightness"]){ + // check it casts to float and support user specifying 0.0f which is default, + // by using the |operator instead of .as https://arduinojson.org/v7/api/jsonvariant/or/ + if ((doc["status_pixel_brightness"] | -1.0f) != -1.0f) { + WS.status_pixel_brightness = doc["status_pixel_brightness"].as(); + } + } + // Close secrets.json file secretsFile.close(); }