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() {
138138 " credentials!\n " );
139139 }
140140
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+
141147 // Close the file
142148 secretsFile.close ();
143149
Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ void Wippersnapper_FS::createSecretsFile() {
325325 strcpy (secretsConfig.aio_key , " YOUR_IO_KEY_HERE" );
326326 strcpy (secretsConfig.network .ssid , " YOUR_WIFI_SSID_HERE" );
327327 strcpy (secretsConfig.network .pass , " YOUR_WIFI_PASS_HERE" );
328- secretsConfig.status_pixel_brightness = 0.2 ;
328+ secretsConfig.status_pixel_brightness = STATUS_PIXEL_BRIGHTNESS_DEFAULT ;
329329
330330 // Serialize the struct to a JSON document
331331 JsonDocument doc;
@@ -452,6 +452,12 @@ void Wippersnapper_FS::parseSecrets() {
452452 " credentials!" );
453453 }
454454
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+
455461 // Close secrets.json file
456462 secretsFile.close ();
457463}
You can’t perform that action at this time.
0 commit comments