diff options
-rwxr-xr-x | bigclown-leds | 2 | ||||
-rw-r--r-- | control/gui.c | 3 | ||||
-rw-r--r-- | control/ledctl.c | 6 | ||||
-rw-r--r-- | control/state.h | 1 |
4 files changed, 9 insertions, 3 deletions
diff --git a/bigclown-leds b/bigclown-leds index 29d2e31..46b3c88 100755 --- a/bigclown-leds +++ b/bigclown-leds @@ -11,7 +11,7 @@ def on_connect(client, userdata, flags, rc): def on_message(client, userdata, msg): topic = msg.topic[26:] if topic == 'effect/set': - # Well for now just this way + # Well for now just this way client.publish( 'node/power-controller:0/led-strip/-/effect/set', '{"type": "rainbow", "wait":50}') diff --git a/control/gui.c b/control/gui.c index e70ff87..1ca6142 100644 --- a/control/gui.c +++ b/control/gui.c @@ -19,6 +19,9 @@ void update_gui() { bc_module_lcd_draw_string(43, 2, "OFF", false); switch (mode) { + case MODE_SOLID_WARM: + bc_module_lcd_draw_string(40, 26, "warm", true); + break; case MODE_SOLID_RED: bc_module_lcd_draw_string(46, 26, "red", true); break; diff --git a/control/ledctl.c b/control/ledctl.c index 76bdc67..8a5bfea 100644 --- a/control/ledctl.c +++ b/control/ledctl.c @@ -5,6 +5,7 @@ const char *mode_string[] = { + [MODE_SOLID_WARM] = "#70200A", [MODE_SOLID_RED] = "#FF0000", [MODE_SOLID_GREEN] = "#00FF00", [MODE_SOLID_BLUE] = "#0000FF", @@ -34,6 +35,7 @@ void click_left() { switch (state) { case STATE_DEFAULT: enabled = 1; + update_mode(); // just to make sure that all is in sync update_brightness(); break; case STATE_BRIGHTNESS_SELECT: @@ -43,7 +45,7 @@ void click_left() { break; case STATE_COLOR_SELECT: if (mode >= MODE_RAINBOW) - mode = MODE_SOLID_RED; + mode = MODE_SOLID_WARM; else mode++; update_mode(); @@ -65,7 +67,7 @@ void click_right() { update_brightness(); break; case STATE_COLOR_SELECT: - if (mode <= MODE_SOLID_RED) + if (mode <= MODE_SOLID_WARM) mode = MODE_RAINBOW; else mode--; diff --git a/control/state.h b/control/state.h index 5f9525f..fab1e12 100644 --- a/control/state.h +++ b/control/state.h @@ -2,6 +2,7 @@ #define _STATE_H_ enum led_mode { + MODE_SOLID_WARM, MODE_SOLID_RED, MODE_SOLID_GREEN, MODE_SOLID_BLUE, |