Skip to content

Commit

Permalink
refactor: use menu feature for control center
Browse files Browse the repository at this point in the history
The `menu` feature is a better choice to display the control center than
using `settings`.
Unfortunately the Settings app cannot be called, since it's language
dependant (e.g. it's called Einstellungen if the ATV is set to German).

Relates to unfoldedcircle/feature-and-bug-tracker#56
  • Loading branch information
zehnm committed Mar 11, 2024
1 parent 327a02e commit 8aeb2bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions intg-appletv/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async def media_player_cmd_handler(
res = await device.set_shuffle(mode) if isinstance(mode, bool) else ucapi.StatusCodes.BAD_REQUEST
case media_player.Commands.CONTEXT_MENU:
res = await device.context_menu()
case media_player.Commands.SETTINGS:
case media_player.Commands.MENU:
res = await device.control_center()

case media_player.Commands.HOME:
Expand Down Expand Up @@ -260,7 +260,7 @@ async def media_player_cmd_handler(
return res


def _get_cmd_param(name: str, params: dict[str, Any] | None) -> str | None:
def _get_cmd_param(name: str, params: dict[str, Any] | None) -> str | bool | None:
if params is None:
return None
return params.get(name)
Expand Down Expand Up @@ -473,7 +473,6 @@ def _register_available_entities(identifier: str, name: str) -> bool:
media_player.Features.DPAD,
media_player.Features.SELECT_SOURCE,
media_player.Features.CONTEXT_MENU,
media_player.Features.SETTINGS,
media_player.Features.MENU,
media_player.Features.REWIND,
media_player.Features.FAST_FORWARD,
Expand Down

0 comments on commit 8aeb2bd

Please sign in to comment.