Start
|
Scan, Pair and Connect
|
Device Information
|
Control
|
Power Management
|
Features
|
Metadata
|
Listeners
|
Stream
|
Storage
|
Apps
|
Audio
|
Keyboard
|
Logging
|
Examples
Control
Controlling a device is done with the remote control interface, interface.RemoteControl. It allows you navigate the menus and change playback (play, pause, etc.).
Using the Remote Control API
After connecting to a device, you get the remote control via interface.AppleTV.remote_control:
atv = await pyatv.connect(config, ...)
rc = atv.remote_control
You can then control via the available functions:
await rc.up()
await rc.select()
await rc.volume_up()
await rc.set_position(100)
All available actions can be found in interface.RemoteControl.
Input Actions
Currently three types of input actions are supported:
- Single tap (“click”)
- Double tap (“double click”)
- Hold
These actions are supported by the following buttons:
- Arrow keys (up, down, left, right)
- Select
- Menu
- Home
By default, const.InputAction.SingleTap are used. Pass another action
to use another input action:
await rc.menu(action=InputAction.Hold)
await rc.home(action=InputAction.DoubleTap)
All input actions are specified in const.InputAction.