File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff 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
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