fixed issue #4

fixed issue #4
implemented Custom Mode in UI
This commit is contained in:
bpohvoodoo
2019-03-19 20:21:57 +01:00
parent 92b3959a6a
commit 0776e8f5f4
9 changed files with 4957 additions and 1651 deletions
+7 -2
View File
@@ -522,6 +522,9 @@ void handleSetWS2812FXMode(uint8_t * mypayload) {
mode = E131;
}
#endif
if (strcmp((char *) &mypayload[1], "custom") == 0) {
mode = CUSTOM;
}
}
}
@@ -611,6 +614,9 @@ String listModesJSON() {
objecte131["mode"] = "e131";
objecte131["name"] = "E131";
#endif
JsonObject objectcustom = root.createNestedObject();
objectcustom["mode"] = "custom";
objectcustom["name"] = "CUSTOM WS";
for (uint8_t i = 0; i < strip->getModeCount(); i++) {
JsonObject object = root.createNestedObject();
object["mode"] = i;
@@ -1787,6 +1793,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
// Request handler for IR remote support
// ***************************************************************************
void handleRemote() {
int chng = 1;
if (irrecv.decode(&results)) {
DBG_OUTPUT_PORT.print("IR Code: 0x");
DBG_OUTPUT_PORT.print(uint64ToString(results.value, HEX));
@@ -1794,8 +1801,6 @@ void handleRemote() {
if (results.value == rmt_commands[REPEATCMD]) { //Repeat
results.value = last_remote_cmd;
chng = 5;
} else {
chng = 1;
}
if (results.value == rmt_commands[ON_OFF]) { // ON/OFF TOGGLE
last_remote_cmd = 0;