Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/provisioning/littlefs/WipperSnapper_LittleFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float> 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();

Expand Down
8 changes: 7 additions & 1 deletion src/provisioning/tinyusb/Wippersnapper_FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<float> 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();
}
Expand Down
Loading