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

"atvremote -s <IP> previous" won't go back to the previous page within an app #2436

Open
zhiningq opened this issue Jul 2, 2024 · 3 comments
Labels
bug confirmation Waiting for confirmation from user

Comments

@zhiningq
Copy link

zhiningq commented Jul 2, 2024

Describe the bug

I wonder if "previous" button works as the "<" button on the actual apple tv remote, if so i think it has a bug while within an app - it won't go back to previous page.

Error log

<place log here>

How to reproduce the bug?

To reproduce: hover over any app, send "atvremote -s previous" wont return back to the first app on home page

What is expected behavior?

Expect first app icon being focused with "previous" command sent

Operating System

macOS

Python

3.12

pyatv

atvremote 0.14.5

Device

Model/SW: Apple TV 4K (gen 3), tvOS 17.5.1 build 21L580

Additional context

N/A

@zhiningq zhiningq added the bug label Jul 2, 2024
@postlund
Copy link
Owner

postlund commented Nov 4, 2024

previous is a media command (like "previous song"), so I wouldn't expect that to work. Maybe left if it is navigation to the left you mean?

@postlund
Copy link
Owner

postlund commented Nov 4, 2024

Or maybe menu is what you want.

@postlund postlund added the confirmation Waiting for confirmation from user label Nov 4, 2024
@Marx314
Copy link

Marx314 commented Nov 19, 2024

What:
pytv 0.16.0 (docker) on a arm,
appletv 4k tvOS: 18.1 22j580
When I send the previous command I assume it's the same button as the physical remote with the < logo, so should go to the previous menu if I'm already within a sub menu.... I get the included stacktrace

atvremote -s 10.0.0.172 previous --debug

logs
previous-appletv-18.1_22j580_tvOS.log

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/mrp/protocol.py", line 275, in _receive
    await semaphore.acquire()
  File "/usr/local/lib/python3.13/asyncio/locks.py", line 407, in acquire
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/pyatv/scripts/atvremote.py", line 997, in _run_application
    return await cli_handler(loop)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/scripts/atvremote.py", line 726, in cli_handler
    return await _handle_commands(args, config, storage, loop)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/scripts/atvremote.py", line 876, in _handle_commands
    ret = await _handle_device_command(args, cmd, atv, storage, loop)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/scripts/atvremote.py", line 919, in _handle_device_command
    return await _exec_command(atv.remote_control, cmd, True, *cmd_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/scripts/atvremote.py", line 964, in _exec_command
    value = await tmp(*args)
            ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/core/facade.py", line 97, in previous
    return await self.relay("previous")()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/mrp/__init__.py", line 402, in previous
    await self._send_command(CommandInfo_pb2.PreviousTrack)
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/mrp/__init__.py", line 342, in _send_command
    resp = await self.protocol.send_and_receive(messages.command(command, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/mrp/protocol.py", line 262, in send_and_receive
    return await self._receive(identifier, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pyatv/protocols/mrp/protocol.py", line 274, in _receive
    async with async_timeout.timeout(timeout):
               ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_timeout/__init__.py", line 141, in __aexit__
    self._do_exit(exc_type)
    ~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/async_timeout/__init__.py", line 228, in _do_exit
    raise asyncio.TimeoutError
TimeoutError```

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

No branches or pull requests

3 participants