-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Improve Plex device handling #48369
< 8000 div class="gh-header-actions mt-0 mb-3 mb-md-2 ml-1 flex-md-order-1 flex-shrink-0 d-flex flex-items-center gap-1">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
Improve Plex device handling #48369
Conversation
@@ -544,6 +545,15 @@ def device_info(self): | |||
if self.machine_identifier is None: | |||
return None | |||
|
|||
if self.device_product in TRANSIENT_DEVICE_MODELS: |
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.
Shouldn't we just return None?
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.
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.
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.
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.
Breaking change
Devices representing Plex Web
media_player
devices will be removed. Any automations, scenes, or scripts based on the device will need to be changed to use themedia_player
entity.Proposed change
This PR removes orphaned devices where the user has removed the associated
media_player
entity.The method for assigning devices for certain Plex
media_player
entities is also changing. Plex Web and Plex for Sonosmedia_player
entities 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: