diff --git a/homeassistant/components/plex/manifest.json b/homeassistant/components/plex/manifest.json index 912732efe9812b0dcb262205eabc9e11e34d0596..1875b0e05dce28796bcfa36c34095c2c45fc9c91 100644 --- a/homeassistant/components/plex/manifest.json +++ b/homeassistant/components/plex/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/plex", "requirements": [ - "plexapi==4.11.2", + "plexapi==4.12.1", "plexauth==0.0.6", "plexwebsocket==0.0.13" ], diff --git a/homeassistant/components/plex/server.py b/homeassistant/components/plex/server.py index b136bec73e925fde7982b16123eea72f602918e2..058e8abbecd328e4f663f06b4e5db7e554e52731 100644 --- a/homeassistant/components/plex/server.py +++ b/homeassistant/components/plex/server.py @@ -462,24 +462,24 @@ class PlexServer: continue session_username = next(iter(session.usernames), None) - for player in session.players: - unique_id = f"{self.machine_identifier}:{player.machineIdentifier}" - if unique_id not in self.active_sessions: - _LOGGER.debug("Creating new Plex session: %s", session) - self.active_sessions[unique_id] = PlexSession(self, session) - if session_username and session_username not in monitored_users: - ignored_clients.add(player.machineIdentifier) - _LOGGER.debug( - "Ignoring %s client owned by '%s'", - player.product, - session_username, - ) - continue + player = session.player + unique_id = f"{self.machine_identifier}:{player.machineIdentifier}" + if unique_id not in self.active_sessions: + _LOGGER.debug("Creating new Plex session: %s", session) + self.active_sessions[unique_id] = PlexSession(self, session) + if session_username and session_username not in monitored_users: + ignored_clients.add(player.machineIdentifier) + _LOGGER.debug( + "Ignoring %s client owned by '%s'", + player.product, + session_username, + ) + continue - process_device("session", player) - available_clients[player.machineIdentifier][ - "session" - ] = self.active_sessions[unique_id] + process_device("session", player) + available_clients[player.machineIdentifier][ + "session" + ] = self.active_sessions[unique_id] for device in devices: process_device("PMS", device) diff --git a/requirements_all.txt b/requirements_all.txt index 54606de114a9dce88c2dabca0d6d2e424e230ed6..48f802fa367210c5c4cbfe41ad112b8e4c6a5ee6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1256,7 +1256,7 @@ pillow==9.2.0 pizzapi==0.0.3 # homeassistant.components.plex -plexapi==4.11.2 +plexapi==4.12.1 # homeassistant.components.plex plexauth==0.0.6 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index c3fc6b31256c0e9973ae31274d4646ec14f392a4..1ffcf08ea573e0f3b700ed57a2da7f2e37d0dc14 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -874,7 +874,7 @@ pilight==0.1.1 pillow==9.2.0 # homeassistant.components.plex -plexapi==4.11.2 +plexapi==4.12.1 # homeassistant.components.plex plexauth==0.0.6