Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atvscript push_updates - output_devices is not supported #2396

Open
stevemac00 opened this issue Apr 30, 2024 · 3 comments
Open

atvscript push_updates - output_devices is not supported #2396

stevemac00 opened this issue Apr 30, 2024 · 3 comments
Labels

Comments

@stevemac00
Copy link

Describe the bug

atvscript -s 10.0.1.29 push_updates throws error immediately.
Goal was to use this update to know if a movie started from atv.launch(deeplink)

Error log

Traceback (most recent call last):\n  
File "python3.11/site-packages/pyatv/scripts/atvscript.py", line 393, in appstart\n args.output(await _handle_command(args, abort_sem, storage, loop)),\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File ".appdevel/venv/lib/python3.11/site-packages/pyatv/scripts/atvscript.py", line 275, in _handle_command\n    return await _run_command(atv, args, abort_sem, loop)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File ".appdevel/venv/lib/python3.11/site-packages/pyatv/scripts/atvscript.py", line 308, in _run_command\n    audio_listener.outputdevices_update([], atv.audio.output_devices)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^\n  File ".appdevel/venv/lib/python3.11/site-packages/pyatv/support/shield.py", line 72, in _guard_method\n    return func(self, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "appdevel/venv/lib/python3.11/site-packages/pyatv/core/facade.py", line 484, in output_devices\n    return self.relay("output_devices")\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File ".appdevel/venv/lib/python3.11/site-packages/pyatv/core/relayer.py", line 90, in relay\n    instance = self._find_instance(\n               ^^^^^^^^^^^^^^^^^^^^\n  File ".appdevel/venv/lib/python3.11/site-packages/pyatv/core/relayer.py", line 114, in _find_instance\n    raise exceptions.NotSupportedError(f"{target} is not supported")\npyatv.exceptions.NotSupportedError: output_devices is not supported\n"}

How to reproduce the bug?

command line above

What is expected behavior?

something else

Operating System

macOS

Python

Other

pyatv

0.14.5

Device

Model/SW: Apple TV 4, tvOS 17.4

Additional context

Unsure what else is relevant. Been working with pyatv now for couple months in a dedicate python app to perform analysis on output (OCR, etc) and worked around any minor issue.

@stevemac00 stevemac00 added the bug label Apr 30, 2024
@postlund
Copy link
Owner

postlund commented May 1, 2024

You are probably lacking credentials for any protocols supporting push updates. Try atvremote wizard, pick your device, follow the instructions and let me know if it works.

@stevemac00
Copy link
Author

stevemac00 commented May 1, 2024 via email

@stevemac00
Copy link
Author

You are probably lacking credentials for any protocols supporting push updates. Try atvremote wizard, pick your device, follow the instructions and let me know if it works.

There's no question I have credentials because I can launch_app and any remove_control, etc. (wizard was first thing I did a month or so ago to snag the creds). My intention was to try atvscript push_updates while using atvremote to test.

I still can't get it to report in my app either (see above reply).

And here's my current code (gleaned from scripts).

creds = config[ipKey]['creds']
for protocol in Protocol:
    name = protocol.name.lower()
    logger.debug(f"protocol={protocol}, name={name}")
    if protocol in (Protocol.Companion, Protocol.RAOP):
        credsResult[name] = conf.set_credentials(protocol, creds[name])
atv = await pyatv.connect(conf, g.evtloop)
atv.listener = DeviceListener()
atv.power.listener = PowerListener()
if atv.features.in_state(FeatureState.Available, FeatureName.PushUpdates):
    atv.push_updater.listener = PushListener()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants