Skip to content

Commit 53ca349

Browse files
committed
Stop blinding status lights
1 parent 16bc28a commit 53ca349

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/provisioning/littlefs/WipperSnapper_LittleFS.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ void WipperSnapper_LittleFS::parseSecrets() {
138138
"credentials!\n");
139139
}
140140

141+
if (doc["status_pixel_brightness"]) {
142+
// check it casts to float and support user specifying 0.0f which is
143+
// default, by using the |operator instead of .as
144+
// https://arduinojson.org/v7/api/jsonvariant/or/
145+
if ((doc["status_pixel_brightness"] | -1.0f) != -1.0f) {
146+
WS.status_pixel_brightness = doc["status_pixel_brightness"].as<float>();
147+
}
148+
}
149+
141150
// Close the file
142151
secretsFile.close();
143152

src/provisioning/tinyusb/Wippersnapper_FS.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,14 @@ void Wippersnapper_FS::parseSecrets() {
452452
"credentials!");
453453
}
454454

455+
if (doc["status_pixel_brightness"]){
456+
// check it casts to float and support user specifying 0.0f which is default,
457+
// by using the |operator instead of .as https://arduinojson.org/v7/api/jsonvariant/or/
458+
if ((doc["status_pixel_brightness"] | -1.0f) != -1.0f) {
459+
WS.status_pixel_brightness = doc["status_pixel_brightness"].as<float>();
460+
}
461+
}
462+
455463
// Close secrets.json file
456464
secretsFile.close();
457465
}

0 commit comments

Comments
 (0)