Skip updates when Plex client viewing photos (#31556)
This commit is contained in:
parent
0e68ace3dd
commit
3a3328dc13
2 changed files with 6 additions and 0 deletions
|
@ -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}"
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue