Skip to content

Commit

Permalink
Stop blinding status lights
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Dec 17, 2024
1 parent 16bc28a commit 53ca349
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/provisioning/littlefs/WipperSnapper_LittleFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>();
}
}

// Close the file
secretsFile.close();

Expand Down
8 changes: 8 additions & 0 deletions src/provisioning/tinyusb/Wippersnapper_FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float>();
}
}

// Close secrets.json file
secretsFile.close();
}
Expand Down

0 comments on commit 53ca349

Please sign in to comment.