Improve Plex device handling#48369
Merged
balloob merged 5 commits intoMar 31, 2021
Merged
Conversation
balloob
reviewed
Mar 29, 2021
balloob
reviewed
Mar 29, 2021
balloob
reviewed
Mar 29, 2021
| if self.machine_identifier is None: | ||
| return None | ||
|
|
||
| if self.device_product in TRANSIENT_DEVICE_MODELS: |
Contributor
Author
There was a problem hiding this comment.
I originally wanted to delete the current devices, but that also removed the associated entities. This moves them to a new service device instead so the old device can get safely removed by the new orphan cleanup code.
Contributor
Author
There was a problem hiding this comment.
BTW, I think I'd actually prefer to not have any devices attached to these entities, but returning None doesn't disassociate them from existing devices.
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.
Breaking change
Devices representing Plex Web
media_playerdevices will be removed. Any automations, scenes, or scripts based on the device will need to be changed to use themedia_playerentity.Proposed change
This PR removes orphaned devices where the user has removed the associated
media_playerentity.The method for assigning devices for certain Plex
media_playerentities is also changing. Plex Web and Plex for Sonosmedia_playerentities represent potentially transient apps or external services. For example, a new Plex Web device is created for each browser login. These should not have permanent devices attached to them. This PR migrates the entities to a new shared "Plex Clients" service. This will also allow cleanup of the old individual devices during a subsequent restart.Type of change
Additional information
Checklist
black --fast homeassistant tests)The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: