diff --git a/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp b/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp index de76fc79f..f564ef93f 100644 --- a/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp +++ b/src/provisioning/littlefs/WipperSnapper_LittleFS.cpp @@ -138,6 +138,12 @@ void WipperSnapper_LittleFS::parseSecrets() { "credentials!\n"); } + // specify type of value for json key, by using the |operator to include + // a typed default value equivalent of with .as w/ default value + // https://arduinojson.org/v7/api/jsonvariant/or/ + WS._config.status_pixel_brightness = + doc["status_pixel_brightness"] | (float)STATUS_PIXEL_BRIGHTNESS_DEFAULT; + // Close the file secretsFile.close(); diff --git a/src/provisioning/tinyusb/Wippersnapper_FS.cpp b/src/provisioning/tinyusb/Wippersnapper_FS.cpp index 5b0abc304..f40698ea7 100644 --- a/src/provisioning/tinyusb/Wippersnapper_FS.cpp +++ b/src/provisioning/tinyusb/Wippersnapper_FS.cpp @@ -325,7 +325,7 @@ void Wippersnapper_FS::createSecretsFile() { strcpy(secretsConfig.aio_key, "YOUR_IO_KEY_HERE"); strcpy(secretsConfig.network.ssid, "YOUR_WIFI_SSID_HERE"); strcpy(secretsConfig.network.pass, "YOUR_WIFI_PASS_HERE"); - secretsConfig.status_pixel_brightness = 0.2; + secretsConfig.status_pixel_brightness = STATUS_PIXEL_BRIGHTNESS_DEFAULT; // Serialize the struct to a JSON document JsonDocument doc; @@ -452,6 +452,12 @@ void Wippersnapper_FS::parseSecrets() { "credentials!"); } + // specify type of value for json key, by using the |operator to include + // a typed default value equivalent of with .as w/ default value + // https://arduinojson.org/v7/api/jsonvariant/or/ + WS._config.status_pixel_brightness = + doc["status_pixel_brightness"] | (float)STATUS_PIXEL_BRIGHTNESS_DEFAULT; + // Close secrets.json file secretsFile.close(); }