-
Notifications
You must be signed in to change notification settings - Fork 11
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 support for media player state #178
Conversation
@rale can you please run pre-commit supplied in this repo locally so it fixes the formatting? https://github.com/home-assistant-libs/aiowebostv/actions/runs/4780101336/jobs/8752249979?pr=178 |
FWIW I have tested remotely against my LG G2 TV and it works great. I'd love to see this functionality merged so it's usable more easily from Home Assistant. |
@andyscott Can you add your TV OS version so that we can confirm what versions support it? |
@thecode yep! I'm out of town at the moment and can't check the WebOS version until I'm back. I believe it was 7.x.x. As for the TV itself, it's:
|
I can confirm that this is working:
WebOS: 7.3.1-39 (mullet-mebbin) |
I would prefer someone with older OS versions check it, I have a TV with an older OS but it is disconnected right now, the main problem would be to verify it doesn't break anything and how we detect that the TV doesn't support it to show it correctly on HA |
On older TVs where it's not supported, client.media_state is None. This is what I've been using myself: home-assistant/core@f3c65c6 |
Hi!
I then started playing a show from the Jellyfin app directly on the tv but nothing more outputted from the script. I let it run for a while, paused, stopped it, to no avail. On the contrary, here's the output when I lower the volume:
Let me know if I can test anything else! |
Is there anything that should be tested before merging this PR? I am eager to see it merged. |
i want to see this merged too :) |
👋🏽 I'd also like to see this merged. Is there anything I can do to help? |
I can (unfortunately) confirm that on an older webOS version (6.3.3-442), C1 series "playing" status is not presented. But all other functionalities are working the same. So for version 6.x it's safe to merge, nothing is broken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rale 👍
Sorry for the delay, just got a TV connected back so I can test it.
When do you think the update will be released in HA ? |
I can release a new version, but someone needs to work on it on HA side. |
Subscribe to and query media player state.
get_media_foreground_app() will return something like this when using the media player:
[{'appId': 'com.webos.app.mediadiscovery', 'playState': 'playing', 'type': 'media', 'mediaId': '_', 'windowId': '_Window_Id_3'}]
It also works with other media apps:
[{'appId': 'amazon', 'playState': 'playing', 'type': 'media', 'mediaId': '_fMe9g81DBtDVNw', 'windowId': '_Window_Id_9'}]
The endpoint used doesn't appear to be available in all versions of webOS. It works for me on a newer TV running webOS 7, but on webOS 3.5, it will throw a aiowebostv.exceptions.WebOsTvServiceNotFoundError: 404 no such service or method.