Start to get rid of Legacy Animations

Start to get rid of Legacy Animations:
tv mode is now selectable on its own (ENABLE_TV)
off mode is now no legacy animation
e131 mode is now no legacy animation
This commit is contained in:
BPoH_Voodoo
2019-02-03 17:13:17 +01:00
parent 6596ce34fa
commit a1ac9f2701
5 changed files with 82 additions and 38 deletions
+5 -2
View File
@@ -197,6 +197,9 @@ $(function(){
$.getJSON("http://" + host + "/status", function(data) {
console.log("status", data);
mode = data.mode;
if (mode == "1") {
// set autoswitch $("#autoSwitch").val('checked');
}
ws2812fx_mode = data.ws2812fx_mode;
$("#rng_delay").val(data.speed);
$("#rng_brightness").val(data.brightness);
@@ -211,14 +214,14 @@ $(function(){
// Load modes async
// List of all color modes
// enum MODE { SET_MODE, HOLD, AUTO, OFF, TV, CUSTOM, SETCOLOR, SETSPEED, BRIGHTNESS, WIPE, RAINBOW, RAINBOWCYCLE, THEATERCHASE, TWINKLERANDOM, THEATERCHASERAINBOW};
// enum MODE {OFF, AUTO, TV, E131, SET_MODE, HOLD, CUSTOM, SETCOLOR, SETSPEED, BRIGHTNESS, WIPE, RAINBOW, RAINBOWCYCLE, THEATERCHASE, TWINKLERANDOM, THEATERCHASERAINBOW};
$.getJSON("http://" + host + "/get_modes", function(data) {
console.log("modes", data);
var modes_html = "";
data.forEach(function(current_mode){
if (current_mode.mode !== undefined) {
modes_html += '<div class="col s12 m6 l6 btn_grid">';
if ((mode == "1" && current_mode.mode == ws2812fx_mode) || (mode == "3" && current_mode.mode == "off") || (mode == "4" && current_mode.mode == "tv") || (mode == "15" && current_mode.mode == "e131")){
if ((mode == "5" && current_mode.mode == ws2812fx_mode) || (mode == "0" && current_mode.mode == "off") || (mode == "2" && current_mode.mode == "tv") || (mode == "3" && current_mode.mode == "e131")){
modes_html += '<a class="btn waves-effect waves-light btn_mode red" name="action" data-mode="' + current_mode.mode + '">(' + current_mode.mode +') '+ current_mode.name;
} else {
modes_html += '<a class="btn waves-effect waves-light btn_mode blue" name="action" data-mode="' + current_mode.mode + '">(' + current_mode.mode +') '+ current_mode.name;