Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/status_led_brightness' into ua…
Browse files Browse the repository at this point in the history
…t-xmas2024
  • Loading branch information
tyeth committed Dec 20, 2024
2 parents 8b62a09 + 9ddb120 commit 418e785
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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

0 comments on commit 418e785

Please sign in to comment.