diff --git a/include/prototypes.h b/include/prototypes.h index 4f36f4d..a579499 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -24,7 +24,8 @@ enum AnimationMode { AM_FLASH, AM_OFF, AM_ERROR, - AM_NONE + AM_NONE, + AM_STATIC }; extern AnimationMode mode; diff --git a/src/main.cpp b/src/main.cpp index 87577fa..850ce9a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -216,10 +216,9 @@ void loop() { nodes[0]->blend_to(((millis() / 1000) % 2 == 0) ? CRGB::Black : color, 0, 64); } - } else if (active_mode == AM_OFF) { - LOGln("Blanking."); + } else if (active_mode == AM_OFF || active_mode == AM_STATIC) { for(Node* node : nodes) { - node->set_color(CRGB::Black); + node->set_color(active_mode == AM_OFF ? CRGB::Black : color); node->draw(); } } else { // This includes AM_ERROR diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 18d4f4c..9cb7e5d 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -50,6 +50,7 @@ void callback(char* topic, byte* pl, unsigned int length) { else if (value.equals("first_corner")) { new_mode = AM_FIRST_CORNER; } else if (value.equals("off")) { new_mode = AM_OFF; } else if (value.equals("flash")) { new_mode = AM_FLASH; } + else if (value.equals("static")) { new_mode = AM_STATIC; } else { LOGln("Unknown mode '%s'.", value.c_str()); } } else if (key.equals("duration")) { duration = value.toInt(); @@ -62,6 +63,9 @@ void callback(char* topic, byte* pl, unsigned int length) { if (value.equals("red")) { color = CRGB::Red; } else if (value.equals("green")) { color = CRGB::Green; } else if (value.equals("blue")) { color = CRGB::Blue; } + else if (value.equals("pink")) { color = CRGB::Pink; } + else if (value.equals("yellow")) { color = CRGB::Yellow; } + else if (value.equals("orange")) { color = CRGB::Orange; } else { LOGln("Unknown color name %s.", value.c_str());} } else { LOGln("Unknown key '%s'. (For reference: Value is '%s'.)", key.c_str(), value.c_str());