From 6ae61895191f408ae3794335715f5b18e222f017 Mon Sep 17 00:00:00 2001 From: jimmy Date: Sun, 30 Nov 2025 18:34:32 +1300 Subject: [PATCH] Revert "Add support for all RGB color order permutations (RGB, RBG, GRB, GBR, BRG, BGR)" This reverts commit f53c57f0360581a3281ca3e859906d3f5672a294. --- src/settings.py | 20 ++++---------------- src/templates/index.html | 17 +++++------------ 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/settings.py b/src/settings.py index cd12526..410ed97 100644 --- a/src/settings.py +++ b/src/settings.py @@ -9,21 +9,8 @@ class Settings(dict): def __init__(self): super().__init__() self.load() # Load settings from file during initialization - self.color_order = self._get_color_order(self.get("color_order", "rgb")) - - def _get_color_order(self, order): - """Convert color order string to tuple of hex string indices. - Hex string format: #RRGGBB where indices are 1, 3, 5 (0-indexed). - Returns tuple (R_index, G_index, B_index) for hex string parsing.""" - color_orders = { - "rgb": (1, 3, 5), # Red at 1, Green at 3, Blue at 5 - "rbg": (1, 5, 3), # Red at 1, Blue at 5, Green at 3 - "grb": (3, 1, 5), # Green at 3, Red at 1, Blue at 5 - "gbr": (3, 5, 1), # Green at 3, Blue at 5, Red at 1 - "brg": (5, 1, 3), # Blue at 5, Red at 1, Green at 3 - "bgr": (5, 3, 1), # Blue at 5, Green at 3, Red at 1 - } - return color_orders.get(order.lower(), (1, 3, 5)) # Default to RGB + if self["color_order"] == "rbg": self.color_order = (1, 5, 3) + else: self.color_order = (1, 3, 5) def set_defaults(self): self["led_pin"] = 10 @@ -97,7 +84,8 @@ class Settings(dict): self.save() machine.reset() elif key == "color_order": - self.color_order = self._get_color_order(value) + if value == "rbg": self.color_order = (1, 5, 3) + else: self.color_order = (1, 3, 5) pass elif key == "id": pass diff --git a/src/templates/index.html b/src/templates/index.html index 263fe19..4e1a112 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -1,4 +1,4 @@ -{% args settings, patterns %} +{% args settings, patterns, mac %} @@ -111,20 +111,13 @@
-
+ - - - - - - - - - - +
+ +

Mac address: {{mac}}