Fix RTW decoder: off-by-one in cmd mapping (issue #664)

The RTW protocol decoder used `encKey - 133` to remap the command,
but the encoder uses encKey values starting at 133 (My), so the
correct offset is 132:

- My (encKey=133) → cmd 1 ✓ (previously: 0=Unknown0, unreachable since '> 133')
- Up (encKey=134) → cmd 2 ✓ (previously: 1=My)
- Down (encKey=136) → cmd 4 ✓ (previously: 3=MyUp)
- ...

Fixes: linked remote presses now correctly update shade position
on RTW motors (Mantion etc.).

Tested with ESP32-WROOM-32 + CC1101 V2.0 + 10x Mantion Italian
motors. Before: rolling code incremented but position stuck.
After: position updates correctly when wall remote is pressed.

Refs: #664
This commit is contained in:
MB 2026-06-05 11:45:00 +02:00
parent eb75868adb
commit a484307e49

View file

@ -156,9 +156,9 @@ void somfy_frame_t::decodeFrame(byte* frame) {
this->proto = radio_proto::RTV; this->proto = radio_proto::RTV;
this->cmd = (somfy_commands)(this->encKey - 148); this->cmd = (somfy_commands)(this->encKey - 148);
} }
else if(this->encKey > 133) { else if(this->encKey >= 133) {
this->proto = radio_proto::RTW; this->proto = radio_proto::RTW;
this->cmd = (somfy_commands)(this->encKey - 133); this->cmd = (somfy_commands)(this->encKey - 132);
} }
} }
else this->proto = radio_proto::RTS; else this->proto = radio_proto::RTS;