From 9c9ca53664a9227c5df268b00a966e347a03c343 Mon Sep 17 00:00:00 2001 From: Pi User Date: Fri, 3 Oct 2025 21:28:28 +1300 Subject: [PATCH] Sync pattern shortnames with LED bar firmware - Add 'on' and 'off' pattern mappings to match LED bar - Document that PATTERN_NAMES must match led-bar/src/patterns.py - Keep backend-specific patterns (sequential_pulse, alternating_phase) separate - Ensures frontend can use the same pattern names as LED bar expects --- src/control_server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/control_server.py b/src/control_server.py index b187a69..1dced28 100644 --- a/src/control_server.py +++ b/src/control_server.py @@ -31,7 +31,10 @@ SOUND_CONTROL_HOST = os.getenv("SOUND_CONTROL_HOST", "127.0.0.1") SOUND_CONTROL_PORT = int(os.getenv("SOUND_CONTROL_PORT", "65433")) # Pattern name mapping for shorter JSON payloads +# These must match the shortnames defined in led-bar/src/patterns.py PATTERN_NAMES = { + "on": "on", + "off": "o", "flicker": "f", "fill_range": "fr", "n_chase": "nc", @@ -40,9 +43,10 @@ PATTERN_NAMES = { "rainbow": "r", "specto": "s", "radiate": "rd", + "segmented_movement": "sm", + # Backend-specific patterns (not sent to LED bars) "sequential_pulse": "sp", "alternating_phase": "ap", - "segmented_movement": "sm", }