Fix RFRemoteControlDevice rf_send_button silently sending malformed payloads#684
Merged
jasonacox merged 1 commit intojasonacox:masterfrom Feb 22, 2026
Merged
Fix RFRemoteControlDevice rf_send_button silently sending malformed payloads#684jasonacox merged 1 commit intojasonacox:masterfrom
jasonacox merged 1 commit intojasonacox:masterfrom
Conversation
…ayloads Three bugs that each independently caused rfstudy_send commands to be ignored by the device: - rf_decode_button: fix missing () on base64.b64decode call; always returned None - send_command: build correct rfstudy_send payload (feq as int, add mode/rate, inject ver into each key dict); study/exit commands are unaffected - rf_send_button: do not forward study_feq into feq; feq=0 tells the device to use the frequency embedded in the code, passing the actual value selects a different chip configuration path Adds regression tests for all three fixes.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes three critical bugs in the RFRemoteControlDevice module that were causing rfstudy_send commands to be silently ignored by the device.
Changes:
- Fixed
rf_decode_buttonmethod missing parentheses onbase64.b64decodecall, which was causing it to always returnNone - Fixed
send_commandto build correct payload structure forrfstudy_sendmode (usefeqas int instead ofstudy_feqas string, addmode/ratefields, injectverinto each key dict) - Fixed
rf_send_buttonto not forwardstudy_feqintofeq;feq=0tells the device to use the frequency embedded in the code itself
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tinytuya/Contrib/RFRemoteControlDevice.py | Fixed three bugs: missing function call parentheses in rf_decode_button, incorrect payload structure in send_command for rfstudy_send mode, and incorrect frequency forwarding in rf_send_button |
| tests.py | Added comprehensive regression tests for all three bug fixes, including test_rf_decode_button_returns_dict and test_rf_send_button_payload_structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
Thanks @kongo09 ! Good fix. 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three bugs that each independently caused rfstudy_send commands to be ignored by the device:
Adds regression tests for all three fixes.