File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,14 @@ 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 default,
143+ // by using the |operator instead of .as https://arduinojson.org/v7/api/jsonvariant/or/
144+ if ((doc[" status_pixel_brightness" ] | -1 .0f ) != -1 .0f ) {
145+ WS.status_pixel_brightness = doc[" status_pixel_brightness" ].as <float >();
146+ }
147+ }
148+
141149 // Close the file
142150 secretsFile.close ();
143151
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments