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() {
138
138
" credentials!\n " );
139
139
}
140
140
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
+
141
150
// Close the file
142
151
secretsFile.close ();
143
152
Original file line number Diff line number Diff line change @@ -452,6 +452,14 @@ void Wippersnapper_FS::parseSecrets() {
452
452
" credentials!" );
453
453
}
454
454
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
+
455
463
// Close secrets.json file
456
464
secretsFile.close ();
457
465
}
You can’t perform that action at this time.
0 commit comments