Skip to content

Commit

Permalink
Bump ArduinoJson dependency
Browse files Browse the repository at this point in the history
Fixes (#23)
  • Loading branch information
srwi committed Apr 11, 2024
1 parent 6357db4 commit 292fc78
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ FastLEDHub allows you to manage all of your [FastLED]([FastLED](https://github.c

### Library dependencies

- ArduinoJson ≥ 6.0
- ArduinoJson ≥ 7.0
- ESPEssentials ≥ 2.1
- FastLED
- LinkedList
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
"url": "https://github.com/srwi"
},
"license": "LGPL-2.1-or-later",
"version": "2.1.3"
"version": "2.2"
}
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name=FastLEDHub
version=2.1.3
version=2.2
author=Stephan Rumswinkel
maintainer=Stephan Rumswinkel
sentence=Control multiple FastLED lightstrip animations on the ESP8266 and ESP32 without reuploading.
paragraph=FastLEDHub allows you to manage all of your FastLED sketches on the ESP8266 and ESP32 with minimal changes to your existing code. It requires little knowledge about the ESP8266/ESP32 platform making in an ideal playground for beginners getting started with FastLED animations.
url=https://github.com/srwi/FastLEDHub.git
category=Display
architectures=esp8266,esp32
depends=WiFiManager,ESPEssentials,ArduinoJson,LinkedList,FastLED,WebSockets
depends=WiFiManager (>= 2.0.0),ESPEssentials (>= 2.1.0),ArduinoJson (>= 7.0.0),LinkedList,FastLED,WebSockets
18 changes: 9 additions & 9 deletions src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bool ConfigClass::initialize()

bool ConfigClass::parseJson(const char *input)
{
StaticJsonDocument<1024> doc;
JsonDocument doc;
DeserializationError error = deserializeJson(doc, input);

if (doc.containsKey("timeZone"))
Expand Down Expand Up @@ -128,12 +128,12 @@ void ConfigClass::getUserConfigJson(JsonDocument &doc)
doc["sunsetOffset"] = sunsetOffset;
doc["sunsetAnimation"] = sunsetAnimation;
doc["startupAnimation"] = startupAnimation;
JsonArray sliderValueArray = doc.createNestedArray("sliderValues");
JsonArray sliderValueArray = doc["sliderValues"].to<JsonArray>();
for (uint16_t i = 0; i < sliderValues.size(); i++)
{
sliderValueArray.add(sliderValues.get(i));
}
JsonArray colorPickerValueArray = doc.createNestedArray("colorPickerValues");
JsonArray colorPickerValueArray = doc["colorPickerValues"].to<JsonArray>();
for (uint16_t i = 0; i < colorPickerValues.size(); i++)
{
colorPickerValueArray.add(rgb2hex(colorPickerValues.get(i)));
Expand All @@ -144,26 +144,26 @@ void ConfigClass::getApplicationStateJson(JsonDocument &doc)
{
doc["status"] = FastLEDHub.getStatus();
doc["currentAnimation"] = FastLEDHub.getCurrentAnimationName();
JsonArray animations = doc.createNestedArray("animations");
JsonArray animations = doc["animations"].to<JsonArray>();
for (uint8_t i = 0; i < FastLEDHub.animations.size(); i++)
{
animations.add(FastLEDHub.animations.get(i)->getName());
}
JsonArray sliders = doc.createNestedArray("sliders");
JsonArray sliders = doc["sliders"].to<JsonArray>();
for (uint8_t i = 0; i < FastLEDHub.sliders.size(); i++)
{
JsonObject slider = sliders.createNestedObject();
JsonObject slider = sliders.add<JsonObject>();
slider["name"] = FastLEDHub.sliders.get(i)->name;
slider["min"] = FastLEDHub.sliders.get(i)->min;
slider["max"] = FastLEDHub.sliders.get(i)->max;
slider["step"] = FastLEDHub.sliders.get(i)->step;
slider["value"] = FastLEDHub.sliders.get(i)->value;
slider["icon"] = FastLEDHub.sliders.get(i)->icon;
}
JsonArray colorPickers = doc.createNestedArray("colorPickers");
JsonArray colorPickers = doc["colorPickers"].to<JsonArray>();
for (uint8_t i = 0; i < FastLEDHub.colorPickers.size(); i++)
{
JsonObject colorPicker = colorPickers.createNestedObject();
JsonObject colorPicker = colorPickers.add<JsonObject>();
colorPicker["name"] = FastLEDHub.colorPickers.get(i)->name;
colorPicker["value"] = rgb2hex(FastLEDHub.colorPickers.get(i)->value);
colorPicker["icon"] = FastLEDHub.colorPickers.get(i)->icon;
Expand All @@ -172,7 +172,7 @@ void ConfigClass::getApplicationStateJson(JsonDocument &doc)

String ConfigClass::asString(bool includeApplicationState)
{
DynamicJsonDocument doc(3072);
JsonDocument doc;

getUserConfigJson(doc);

Expand Down

0 comments on commit 292fc78

Please sign in to comment.