Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No command line control? #8

Open
Josephur opened this issue Sep 30, 2022 · 3 comments · May be fixed by #11
Open

No command line control? #8

Josephur opened this issue Sep 30, 2022 · 3 comments · May be fixed by #11

Comments

@Josephur
Copy link

This is a great thing... however why no command line way to send a single keypress? Seems simple enough to implement.. was just wondering why this was never added to this project? Could be useful for bash scripting for example.

roku ip.addr -c H (to send home for example)

If I knew enough Python I'd attempt to add it myself, perhaps this is the motivation I need to do so :)

@ncmiller
Copy link
Owner

ncmiller commented Oct 1, 2022

why no command line way to send a single keypress? Seems simple enough to implement.. was just wondering why this was never added to this project?

No specific reason, I just didn't consider the bash scripting use-case (it was originally intended to be used interactively).

It's a good idea, and I agree it probably wouldn't be too hard to implement. If you want to take a shot at implementing it, I'd welcome a pull request.

@Josephur
Copy link
Author

Josephur commented Oct 1, 2022

I may give it a crack, would need two options perhaps, one for the command itself to be sent and perhaps a delay flag to set the delay between keys sent.

Legend28469 added a commit to Legend28469/roku-cli that referenced this issue Nov 13, 2024
Adds a new -c/--command flag that enables script mode for automation:
- Case-insensitive command parsing
- Comma-separated commands with optional spaces
- Special commands: TEXT: and WAIT:
- Verbose command names for better readability
- Maintains backward compatibility with interactive mode

Example:
  roku -c "home, WAIT:1, down, TEXT:Breaking Bad"

Closes ncmiller#8
@Legend28469 Legend28469 linked a pull request Nov 13, 2024 that will close this issue
@Legend28469
Copy link

I've implemented the command-line functionality with the following features:

  • Added -c/--command flag for script mode
  • Commands can be chained with commas (spaces optional)
  • Case-insensitive command names
  • Built-in 0.1s delay between commands for stability
  • Special commands:
    • WAIT:seconds for custom delays
    • TEXT:string for text input

I've also added verbose command names (like 'home' instead of 'H') for better script readability while maintaining backward compatibility with the interactive mode.

Ready for review.
Let me know if any adjustments are needed.

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 a pull request may close this issue.

3 participants