From 60419a37aabc28c72118520af677b03e1d5174a5 Mon Sep 17 00:00:00 2001 From: cjkas Date: Sun, 11 Oct 2026 13:20:49 +0200 Subject: [PATCH] fix: parse the command names the firmware reports shadeCommand events (and the Home Assistant events built from them) name commands "Step Up", "Sun Flag", "My+Up" and so on, but parsing those names fell through to the prefix shortcuts: "Step Up" became SunFlag, "Sun Flag" became StepUp and "My+Up" became My. Match the reported names exactly before the shortcuts. Co-Authored-By: Claude Opus 5.5 --- src/SomfyFrame.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/SomfyFrame.cpp b/src/SomfyFrame.cpp index 9e58f7d..adf978f 100644 --- a/src/SomfyFrame.cpp +++ b/src/SomfyFrame.cpp @@ -21,6 +21,14 @@ somfy_commands translateSomfyCommand(const String& string) { else if (string.equalsIgnoreCase("Toggle")) return somfy_commands::Toggle; else if (string.equalsIgnoreCase("Favorite")) return somfy_commands::Favorite; else if (string.equalsIgnoreCase("Stop")) return somfy_commands::Stop; + // The names translateSomfyCommand(cmd) reports so they parse back. + else if (string.equalsIgnoreCase("Sun Flag")) return somfy_commands::SunFlag; + else if (string.equalsIgnoreCase("Step Up")) return somfy_commands::StepUp; + else if (string.equalsIgnoreCase("Step Down")) return somfy_commands::StepDown; + else if (string.equalsIgnoreCase("My+Up")) return somfy_commands::MyUp; + else if (string.equalsIgnoreCase("Up+Down")) return somfy_commands::UpDown; + else if (string.equalsIgnoreCase("My+Down")) return somfy_commands::MyDown; + else if (string.equalsIgnoreCase("My+Up+Down")) return somfy_commands::MyUpDown; else if (string.startsWith("fav") || string.startsWith("FAV")) return somfy_commands::Favorite; else if (string.startsWith("mud") || string.startsWith("MUD")) return somfy_commands::MyUpDown; else if (string.startsWith("md") || string.startsWith("MD")) return somfy_commands::MyDown;