Change overvoltage signaling to static yellow
authorNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 17 Sep 2024 09:39:03 +0000 (11:39 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 17 Sep 2024 09:39:03 +0000 (11:39 +0200)
Fix "yellow" color for forced mode command.

v10/interface.c

index 1cf9ff7..15cc293 100644 (file)
@@ -299,20 +299,18 @@ void interface_update(char heat_mode)
                        blink = 0;
                } else {
                        switch (heat_mode) {
-                               case mode_water_critical: /* Both Leds to Full RED */
+                               case mode_water_critical: /* Both Leds Full RED Blinking */
                                        if (blink == 0) {
                                                ws2812_set_pixel(&ws2812_leds, 0, 255, 0, 0);
                                                ws2812_set_pixel(&ws2812_leds, 1, 255, 0, 0);
                                                blink = 1;
                                        }
                                        break;
-                               case mode_overvoltage: /* First Led Red blinking */
-                                       if (blink == 0) {
-                                               ws2812_set_pixel(&ws2812_leds, 0, 255, 0, 0);
-                                               blink = 1;
-                                       }
+                               case mode_overvoltage: /* Both Leds yellow */
+                                       ws2812_set_pixel(&ws2812_leds, 0, 100, 100, 0);
+                                       ws2812_set_pixel(&ws2812_leds, 1, 100, 100, 0);
                                        break;
-                               case mode_overtemp: /* Second Led Red blinking */
+                               case mode_overtemp: /* Second Led (RGB1) Red blinking */
                                        if (blink == 0) {
                                                ws2812_set_pixel(&ws2812_leds, 1, 255, 0, 0);
                                                blink = 1;
@@ -323,11 +321,13 @@ void interface_update(char heat_mode)
                                                green = command_val;
                                        } else  if (heat_mode == mode_forced) { /* -> Yellow */
                                                green = command_val;
-                                               blue = command_val;
+                                               red = command_val;
                                        } else {                  /* -> Blue */
                                                blue = command_val;
                                        }
+                                       /* RGB2 : Home power used and Solar production */
                                        ws2812_set_pixel(&ws2812_leds, 0, (home_conso_value / 2000), (solar_prod_value / 2000), 0);
+                                       /* RGB1 : Command value */
                                        ws2812_set_pixel(&ws2812_leds, 1, red, green, blue);
                                        break;
                        }