Plex mark devices unavailable if they 'vanish' and clear media#12811
Merged
balloob merged 8 commits intohome-assistant:devfrom Mar 9, 2018
ryanm101:plex_markUnavaileable
Merged
Plex mark devices unavailable if they 'vanish' and clear media#12811balloob merged 8 commits intohome-assistant:devfrom ryanm101:plex_markUnavaileable
balloob merged 8 commits intohome-assistant:devfrom
ryanm101:plex_markUnavaileable
Conversation
houndci-bot
reviewed
Mar 1, 2018
|
|
||
| self._media_image_url = thumb_url | ||
|
|
||
| def set_availability(self,available): |
balloob
approved these changes
Mar 2, 2018
syssi
reviewed
Mar 3, 2018
| """Initialize the Plex device.""" | ||
| self._app_name = '' | ||
| self._device = None | ||
| self._is_device_available = False |
syssi
reviewed
Mar 3, 2018
| if new_plex_clients: | ||
| add_devices_callback(new_plex_clients) | ||
|
|
||
| for cid in hass.data[PLEX_DATA].keys(): |
Member
There was a problem hiding this comment.
Contributor
Author
There was a problem hiding this comment.
yes this could be moved.
syssi
reviewed
Mar 3, 2018
| return | ||
|
|
||
| new_plex_clients = [] | ||
| available_ids = [] |
Member
There was a problem hiding this comment.
I would prefer available_client_ids here.
Contributor
Author
There was a problem hiding this comment.
Yes that would make more sense
Member
|
Did you see |
syssi
requested changes
Mar 3, 2018
Member
syssi
left a comment
There was a problem hiding this comment.
Just remove all your code 😉 and use _is_player_available as identifier for def available. There is a bug somewhere. Please don't implement duplicated logic.
Contributor
Author
|
@syssi Removing all my code and using player available results in player IDLE not unavailable. |
Renamed '_is_device_available' to '_available' Renamed 'available_ids' to 'available_client_ids'
houndci-bot
reviewed
Mar 9, 2018
| # force devices to idle that do not have a valid session | ||
| if client.session is None: | ||
| client.force_idle() | ||
|
|
Contributor
Author
balloob
pushed a commit
that referenced
this pull request
Mar 9, 2018
* Marks Devices unavailable if they 'vanish' and clears media * Fixed PEP8 complaint * Fixed Linting * Lint Fix * Fix redine of id * More lint fixes * Removed redundant loop for setting availability of client Renamed '_is_device_available' to '_available' Renamed 'available_ids' to 'available_client_ids' * removed whitespace per houndCI
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partial Fix for:
#10074
if a client vanishes it will persist in UI however it is marked Unavailable and media images are cleared