Merge pull request #19 from FabLab-Luenen/development
added custom effect to MQTT
This commit is contained in:
@@ -54,8 +54,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ARDUINOJSON_VERSION)
|
#if defined(ARDUINOJSON_VERSION)
|
||||||
#if !(ARDUINOJSON_VERSION_MAJOR == 6 and ARDUINOJSON_VERSION_MINOR == 9)
|
#if !(ARDUINOJSON_VERSION_MAJOR == 6 and ARDUINOJSON_VERSION_MINOR == 10)
|
||||||
#error "Install ArduinoJson v6.9.x"
|
#error "Install ArduinoJson v6.10.x"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1131,12 +1131,16 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
|
|||||||
} else {
|
} else {
|
||||||
if (mode == E131){
|
if (mode == E131){
|
||||||
root["effect"] = "E131";
|
root["effect"] = "E131";
|
||||||
|
} else {
|
||||||
|
if (mode == CUSTOM){
|
||||||
|
root["effect"] = "CUSTOM WS";
|
||||||
} else {
|
} else {
|
||||||
root["effect"] = strip->getModeName(strip->getMode());
|
root["effect"] = strip->getModeName(strip->getMode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
char buffer[measureJson(root) + 1];
|
char buffer[measureJson(root) + 1];
|
||||||
serializeJson(root, buffer, sizeof(buffer));
|
serializeJson(root, buffer, sizeof(buffer));
|
||||||
@@ -1248,6 +1252,9 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
|
|||||||
mode = E131;
|
mode = E131;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if(effectString == "CUSTOM WS"){
|
||||||
|
mode = CUSTOM;
|
||||||
|
}
|
||||||
for (uint8_t i = 0; i < strip->getModeCount(); i++) {
|
for (uint8_t i = 0; i < strip->getModeCount(); i++) {
|
||||||
if(String(strip->getModeName(i)) == effectString) {
|
if(String(strip->getModeName(i)) == effectString) {
|
||||||
mode = SET_MODE;
|
mode = SET_MODE;
|
||||||
@@ -1346,6 +1353,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
|
|||||||
#if defined(ENABLE_E131)
|
#if defined(ENABLE_E131)
|
||||||
effect_list.add("E131");
|
effect_list.add("E131");
|
||||||
#endif
|
#endif
|
||||||
|
effect_list.add("CUSTOM WS");
|
||||||
for (uint8_t i = 0; i < strip->getModeCount(); i++) {
|
for (uint8_t i = 0; i < strip->getModeCount(); i++) {
|
||||||
effect_list.add(strip->getModeName(i));
|
effect_list.add(strip->getModeName(i));
|
||||||
}
|
}
|
||||||
@@ -1458,6 +1466,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
|
|||||||
#if defined(ENABLE_E131)
|
#if defined(ENABLE_E131)
|
||||||
effect_list.add("E131");
|
effect_list.add("E131");
|
||||||
#endif
|
#endif
|
||||||
|
effect_list.add("CUSTOM WS");
|
||||||
for (uint8_t i = 0; i < strip->getModeCount(); i++) {
|
for (uint8_t i = 0; i < strip->getModeCount(); i++) {
|
||||||
effect_list.add(strip->getModeName(i));
|
effect_list.add(strip->getModeName(i));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -77,7 +77,7 @@ platform = ${common.platform}
|
|||||||
board_build.f_cpu = 160000000L
|
board_build.f_cpu = 160000000L
|
||||||
build_flags =
|
build_flags =
|
||||||
${common.build_flags}
|
${common.build_flags}
|
||||||
-Wl,-Teagle.flash.4m3m.ld ; Required for core > v2.5.0 or staging version
|
-Wl,-Teagle.flash.4m2m.ld ; Required for core > v2.5.0 or staging version
|
||||||
monitor_speed = ${common.monitor_speed}
|
monitor_speed = ${common.monitor_speed}
|
||||||
upload_speed = ${common.upload_speed}
|
upload_speed = ${common.upload_speed}
|
||||||
upload_resetmethod = ${common.upload_resetmethod}
|
upload_resetmethod = ${common.upload_resetmethod}
|
||||||
|
|||||||
Reference in New Issue
Block a user