Skip updates when Plex client viewing photos (#31556)

This commit is contained in:
jjlawren 2020-02-06 16:26:34 -06:00 committed by GitHub
parent 0e68ace3dd
commit 3a3328dc13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -101,6 +101,9 @@ class PlexSensor(Entity):
_LOGGER.debug("Refreshing sensor [%s]", self.unique_id)
now_playing = []
for sess in self.sessions:
if sess.TYPE == "photo":
_LOGGER.debug("Photo session detected, skipping: %s", sess)
continue
user = sess.usernames[0]
device = sess.players[0].title
now_playing_user = f"{user} - {device}"

View file

@ -132,6 +132,9 @@ class PlexServer:
_LOGGER.debug("New device: %s", device.machineIdentifier)
for session in sessions:
if session.TYPE == "photo":
_LOGGER.debug("Photo session detected, skipping: %s", session)
continue
for player in session.players:
self._known_idle.discard(player.machineIdentifier)
available_clients.setdefault(