Update Plex via websockets (#28158)
* Save client identifier from auth for future use * Use websocket events to update Plex * Handle websocket disconnections * Use aiohttp, shut down socket cleanly * Bad rebase fix * Don't connect websocket during config_flow validation, fix tests * Move websocket handling to external library * Close websocket session on HA stop * Use external library, revert unnecessary test change * Async & lint fixes * Clean up websocket stopper on entry unload * Setup websocket in component, pass actual needed object to library
This commit is contained in:
1 parent
9153729b21
commit
43c7b57d1e
7 files changed
+52
-13
No files matched your search
@@ -103,6 +103,8 @@ class PlexServer:
|
||||
|
||||
def update_platforms(self):
|
||||
"""Update the platform entities."""
|
||||
_LOGGER.debug("Updating devices")
|
||||
|
||||
available_clients = {}
|
||||
new_clients = set()
|
||||
|
||||
@@ -164,6 +166,11 @@ class PlexServer:
|
||||
sessions,
|
||||
)
|
||||
|
||||
@property
|
||||
def plex_server(self):
|
||||
"""Return the plexapi PlexServer instance."""
|
||||
return self._plex_server
|
||||
|
||||
@property
|
||||
def friendly_name(self):
|
||||
"""Return name of connected Plex server."""
|
||||
|
||||
Reference in new issue
Block a user