-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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 OnResume event to handle play status correctly #14403
Conversation
@@ -392,7 +393,7 @@ def state(self): | |||
if not self._players: | |||
return STATE_IDLE | |||
|
|||
if self._properties['speed'] == 0 and not self._properties['live']: |
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.
Why was this removed?
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.
see related issue from description
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.
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.
The problem with this is that the state will change if the stream buffers, so if you're watching something which keeps buffering it'll trigger whatever state change actions you have set (which for me is lights, which quickly becomes annoying)
if MEDIA_TYPES.get(self._item.get('type')) is None and self._players: | ||
return MEDIA_TYPES.get(self._players[0]['type']) | ||
return MEDIA_TYPES.get(self._item.get('type')) | ||
return self._item.get('title') or self._item.get('label') or self._item.get('file') |
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.
line too long (91 > 79 characters)
I added another fix to the PR. title is still present as an empty string in the response even if not set and so get() with default doesn't work. dictionary get() |
Description:
Related issue (if applicable): fixes #14394
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices: