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

Feature request. Add getting state of running app #89

Open
OlgaSolod opened this issue Feb 27, 2023 · 2 comments
Open

Feature request. Add getting state of running app #89

OlgaSolod opened this issue Feb 27, 2023 · 2 comments

Comments

@OlgaSolod
Copy link

OlgaSolod commented Feb 27, 2023

Hello!
For example, some TV can be slowly, so when I run the app, i don't know its current state, and can't be sure, that I can continue to execute another actions with app via code. Now I use sleep for it, but it is still too flaky code.
Here is my piece of code:

dev_mode = [x for x in apps if 'developer' in x['title'].lower()][0]
app.launch(dev_mode)
sleep(7) # it needs because smarttv too slowly, may be needed more

Or, may be you can show me more effective way for it?

@supersaiyanmode
Copy link
Owner

I can think of a few things:

  1. app.subscribe_get_current(..) would let you know when the foreground application has changed. However, this may or may not be what you're looking for. The application could still be loading after this message gets delivered to you.
  2. Can you try app.launch(..., block=True)?

@OlgaSolod
Copy link
Author

Thank you for response and recommendations.
I will check both of them and will write you the result.

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

No branches or pull requests

2 participants