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

Add ability to close or force close applications #2349

Open
DennisFury opened this issue Feb 7, 2024 · 1 comment
Open

Add ability to close or force close applications #2349

DennisFury opened this issue Feb 7, 2024 · 1 comment
Labels

Comments

@DennisFury
Copy link

What feature would you like?

It would be great if I could close an application / or force close Apple TV applications. or even restart the unit through atvremote.

Describe the solution you'd like

The ability to force close an application would solve a problem for me. I run tons of home automations (dozen +) around the PlexAPI. Sometimes, play lists / play queues fail to play with a spinning wheel of death. Usually happens when my NAS doesn't spin up quick enough. The solution is always to force close Plex, reopen it, and attempt to play again. I solve this currently in a very harsh fashion-- if my requested content isn't playing ~15 seconds after it's supposed to play, I turn off the power to the smart switch for the apple TV, turn it back on, then it reattempts. I'm afraid I'm shortening the life of my Apple TVs by doing this 2-3 times a week. If I could simply force close the Plex app through scripting (hello atvremote), then I wouldn't have to ungracefully power off my Apple TVs.

Any other information to share?

Nothing, love this project!

@DennisFury
Copy link
Author

DennisFury commented Feb 8, 2024

Actually never mind, got a work-around now that I'm forced to think about it...

def atv_command(ip_address, room, protocol, command):
    return os.popen(f"atvremote -s {ip_address} --{protocol}-credentials `cat ~/Scripts/{protocol}_credentials_{room}` {command}").read()

atv_command('10.11.11.26', 'lr', 'airplay', "home home")
time.sleep(1)
atv_command('10.11.11.26', 'lr', 'airplay', "up up home")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant