Skip to content

AttributeError when interacting with Sonos timelines #1523

@nesati

Description

@nesati

Describe the Bug

Traceback (most recent call last):
  File "/home/user/bug_report.py", line 10, in <module>
    for timeline in client.timelines():
                    ~~~~~~~~~~~~~~~~^^
  File "/home/user/miniconda3/envs/shadowloop/lib/python3.13/site-packages/plexapi/client.py", line 578, in timelines
    if t - self._timeline_cache_timestamp > 1:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PlexSonosClient' object has no attribute '_timeline_cache_timestamp'

Code Snippets

from plexapi.myplex import MyPlexAccount
from plexapi.server import PlexServer

baseurl = 'http://plexserver:32400'
token = '2ffLuB84dqLswk9skLos'
account = MyPlexAccount(token=token)
server = PlexServer(baseurl, token)

for client in account.sonos_speakers():
    for timeline in client.timelines():
        if timeline.key is not None:
            item = server.library.fetchItem(timeline.key)
            print(client.machineIdentifier, client.title, item)

Expected Behavior

I expect it to work like normal PlexClient without the exception

Additional Context

No response

Operating System and Version

Manjaro

Plex Media Server Version

1.41.6.9685

Python Version

3.13

PlexAPI Version

4.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions