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}}