Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Commit a07fdd6

Browse files
authored
Merge pull request #293 from toblum/develop
v2.1.9
2 parents 20e6bc5 + 228666a commit a07fdd6

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

Arduino/McLighting/McLighting.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
#endif
5454

5555
#ifdef ARDUINOJSON_VERSION
56-
#if !(ARDUINOJSON_VERSION_MAJOR == 6 and ARDUINOJSON_VERSION_MINOR == 6)
57-
#error "Install ArduinoJson v6.6.0-beta"
56+
#if !(ARDUINOJSON_VERSION_MAJOR == 6 and ARDUINOJSON_VERSION_MINOR == 7)
57+
#error "Install ArduinoJson v6.7.0-beta"
5858
#endif
5959
#endif
6060

Arduino/McLighting/request_handlers.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
765765
}
766766

767767
void sendState() {
768-
const size_t bufferSize = JSON_OBJECT_SIZE(3) + JSON_OBJECT_SIZE(6);
768+
const size_t bufferSize = JSON_OBJECT_SIZE(3) + JSON_OBJECT_SIZE(6) + 500;
769769
DynamicJsonDocument jsonBuffer(bufferSize);
770770
JsonObject root = jsonBuffer.to<JsonObject>();
771771

@@ -781,9 +781,9 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
781781

782782
root["speed"] = ws2812fx_speed;
783783

784-
char modeName[30];
785-
strncpy_P(modeName, (PGM_P)strip.getModeName(strip.getMode()), sizeof(modeName)); // copy from progmem
786-
root["effect"] = modeName;
784+
//char modeName[30];
785+
//strncpy_P(modeName, (PGM_P)strip.getModeName(strip.getMode()), sizeof(modeName)); // copy from progmem
786+
root["effect"] = strip.getModeName(strip.getMode());
787787

788788
char buffer[measureJson(root) + 1];
789789
serializeJson(root, buffer, sizeof(buffer));
@@ -1203,7 +1203,7 @@ bool writeConfigFS(bool saveConfig){
12031203
json["mqtt_user"] = mqtt_user;
12041204
json["mqtt_pass"] = mqtt_pass;
12051205

1206-
// SPIFFS.remove("/config.json") ? DBG_OUTPUT_PORT.println("removed file") : DBG_OUTPUT_PORT.println("failed removing file");
1206+
//SPIFFS.remove("/config.json") ? DBG_OUTPUT_PORT.println("removed file") : DBG_OUTPUT_PORT.println("failed removing file");
12071207
File configFile = SPIFFS.open("/config.json", "w");
12081208
if (!configFile) DBG_OUTPUT_PORT.println("failed to open config file for writing");
12091209

@@ -1275,7 +1275,7 @@ bool writeStateFS(){
12751275
json["green"] = main_color.green;
12761276
json["blue"] = main_color.blue;
12771277

1278-
// SPIFFS.remove("/state.json") ? DBG_OUTPUT_PORT.println("removed file") : DBG_OUTPUT_PORT.println("failed removing file");
1278+
//SPIFFS.remove("/stripstate.json") ? DBG_OUTPUT_PORT.println("removed file") : DBG_OUTPUT_PORT.println("failed removing file");
12791279
File configFile = SPIFFS.open("/stripstate.json", "w");
12801280
if (!configFile) {
12811281
DBG_OUTPUT_PORT.println("Failed!");

Arduino/McLighting/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define SKETCH_VERSION "2.1.8"
1+
#define SKETCH_VERSION "2.1.9"

Arduino/McLighting/version_info.ino

+6
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,10 @@
3535
* 11 Dec 2018 v 2.1.8
3636
* - Fix Auto-Discovery for HA version >= 0.84 #286
3737
* - Fix #283
38+
*
39+
* 13 Dec 2018 v 2.1.9
40+
* - HA is not getting the correct animation name being run, boils down to changes to ArduinoJson library
41+
* - Bump ArduinoJson library requirment for v6.7.0-beta (better memory management)
42+
* - sendState() needs extra memory for jsonBuffer
43+
* - sensState() effect can be sent directly instead of copying from PROGMEM
3844
*/

0 commit comments

Comments
 (0)