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 <noreply@anthropic.com>
This commit is contained in:
cjkas 2026-10-11 13:20:49 +02:00
parent 3774aba45c
commit 60419a37aa

View file

@ -21,6 +21,14 @@ somfy_commands translateSomfyCommand(const String& string) {
else if (string.equalsIgnoreCase("Toggle")) return somfy_commands::Toggle; else if (string.equalsIgnoreCase("Toggle")) return somfy_commands::Toggle;
else if (string.equalsIgnoreCase("Favorite")) return somfy_commands::Favorite; else if (string.equalsIgnoreCase("Favorite")) return somfy_commands::Favorite;
else if (string.equalsIgnoreCase("Stop")) return somfy_commands::Stop; 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("fav") || string.startsWith("FAV")) return somfy_commands::Favorite;
else if (string.startsWith("mud") || string.startsWith("MUD")) return somfy_commands::MyUpDown; else if (string.startsWith("mud") || string.startsWith("MUD")) return somfy_commands::MyUpDown;
else if (string.startsWith("md") || string.startsWith("MD")) return somfy_commands::MyDown; else if (string.startsWith("md") || string.startsWith("MD")) return somfy_commands::MyDown;