Skip to content

[bug] pyatv.exceptions.BlockedStateError: remote_control is blocked #300

@kennymc-c

Description

@kennymc-c

Is there an existing issue for this?

  • I have searched the existing issues

Description

I recently added my Apple TV to Home Assistant. As a result, operation via Remote Two no longer worked. The log showed the following message:

2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	pyatv.exceptions.BlockedStateError: remote_control is blocked
2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	  File "pyatv/support/shield.py", line 71, in _guard_method
2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	  File "tv.py", line 441, in cursorLeft
2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	  File "driver.py", line 369, in event_handler
2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	  File "pyee/base.py", line 139, in _emit_handle_potential_error
2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	  File "pyee/base.py", line 179, in emit
2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	  File "pyee/asyncio.py", line 71, in callback
2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	  File "asyncio/events.py", line 81, in _run
2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	Traceback (most recent call last):
2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	handle: <Handle AsyncIOEventEmitter._emit_run.<locals>.callback(<Task finishe... is blocked')>) at pyee/asyncio.py:65>
2024-01-29 17:19:27.183139 +00:00	intg-appletv	INFO	ERROR:asyncio:Exception in callback AsyncIOEventEmitter._emit_run.<locals>.callback(<Task finishe... is blocked')>) at pyee/asyncio.py:65
2024-01-29 17:19:27.177180 +00:00	intg-appletv	INFO	DEBUG:ucapi.api:<-: {"kind":"req","id":21,"msg":"entity_command","msg_data":{"cmd_id":"cursor_left","entity_id":"40FC6C78-E08D-4A6B-9CBC-37078152133E","entity_type":"media_player"}}

Only after I removed the ATV from HA again, removed all corresponding remote apps in the ATV settings, removed the entity in the integration menu and then restarted the setup I was able to operate the device via the remote again. Before that, I only got messages like service not available or a timeout.

How to Reproduce

  1. Add Apple TV to Remote Two
  2. Add the same Apple TV to Home Assistant
  3. Try to control the Apple TV via Remote Two

Expected behavior

The Apple TV can be fully controlled via Remote Two

System version

1.6.7

What part of the system affected by the problem?

Integration

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingintegrationIntegration driver related issue

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions