Skip to content

Fixing RF setup issue#362

Merged
Danielhiversen merged 2 commits into
mjg59:masterfrom
catch-twenty-two:master
May 12, 2020
Merged

Fixing RF setup issue#362
Danielhiversen merged 2 commits into
mjg59:masterfrom
catch-twenty-two:master

Conversation

@catch-twenty-two
Copy link
Copy Markdown
Contributor

@catch-twenty-two catch-twenty-two commented May 10, 2020

May fix issue similar to #358 in the cli. Couldn't get anything to work until I added a pause before pulling data and added logic to skip learning IR if a RF argument had been given. Also had to implement this fix for my specific device #360

@catch-twenty-two catch-twenty-two changed the title Fixing https://github.com/mjg59/python-broadlink/issues/358 Fixing RF setup issue May 10, 2020
Comment thread cli/broadlink_cli Outdated
if args.durations else bytearray.fromhex(''.join(args.data))
dev.send_data(data)
if args.learn or args.learnfile:
if (args.learn or args.learnfile) and not args.rfscanlearn:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason to add this conditional because these arguments are exclusive. The user will never use both on the same call.

Copy link
Copy Markdown
Contributor Author

@catch-twenty-two catch-twenty-two May 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it force a "learnfile" parameter here?

with open(args.learnfile, "w") as text_file:

Which in that case you have entered rfscanlearn and learnfile as args

Maybe I'm not clear on what the proper command should be to learn rf and store it to a file?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I understand now. Looks good to me. A suggestion:

if args.learn or (args.learnfile and not args.rfscanlearn):

Comment thread cli/broadlink_cli Outdated
data = None
timeout = 20

time.sleep(10)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what you are doing here. You were getting a ReadError, right? This will be resolved with this PR, we don't need to wait 10 secs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! glad to hear it, I can remove this change

@felipediel
Copy link
Copy Markdown
Collaborator

@catch-twenty-two Apart from that, is the RF working for the RM4 Pro? Can you learn and send commands normally?

@catch-twenty-two
Copy link
Copy Markdown
Contributor Author

catch-twenty-two commented May 11, 2020

@catch-twenty-two Apart from that, is the RF working for the RM4 Pro? Can you learn and send commands normally?

Yes after these fixes I was able to pair RF with my RM 4 Pro and send commands

@Danielhiversen Danielhiversen merged commit 1dfdb06 into mjg59:master May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants