File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,12 @@ void WipperSnapper_LittleFS::parseSecrets() {
138
138
" credentials!\n " );
139
139
}
140
140
141
+ // specify type of value for json key, by using the |operator to include
142
+ // a typed default value equivalent of with .as<float> w/ default value
143
+ // https://arduinojson.org/v7/api/jsonvariant/or/
144
+ WS._config .status_pixel_brightness =
145
+ doc[" status_pixel_brightness" ] | (float )STATUS_PIXEL_BRIGHTNESS_DEFAULT;
146
+
141
147
// Close the file
142
148
secretsFile.close ();
143
149
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ void Wippersnapper_FS::createSecretsFile() {
325
325
strcpy (secretsConfig.aio_key , " YOUR_IO_KEY_HERE" );
326
326
strcpy (secretsConfig.network .ssid , " YOUR_WIFI_SSID_HERE" );
327
327
strcpy (secretsConfig.network .pass , " YOUR_WIFI_PASS_HERE" );
328
- secretsConfig.status_pixel_brightness = 0.2 ;
328
+ secretsConfig.status_pixel_brightness = STATUS_PIXEL_BRIGHTNESS_DEFAULT ;
329
329
330
330
// Serialize the struct to a JSON document
331
331
JsonDocument doc;
@@ -452,6 +452,12 @@ void Wippersnapper_FS::parseSecrets() {
452
452
" credentials!" );
453
453
}
454
454
455
+ // specify type of value for json key, by using the |operator to include
456
+ // a typed default value equivalent of with .as<float> w/ default value
457
+ // https://arduinojson.org/v7/api/jsonvariant/or/
458
+ WS._config .status_pixel_brightness =
459
+ doc[" status_pixel_brightness" ] | (float )STATUS_PIXEL_BRIGHTNESS_DEFAULT;
460
+
455
461
// Close secrets.json file
456
462
secretsFile.close ();
457
463
}
You can’t perform that action at this time.
0 commit comments