hass-core/homeassistant/components/remote/services.yaml
Felipe Martins Diel 0ed9e185b2 Add support for learning new commands (#23888)
* Add support for learning new commands

This update creates a generic service in the 'remote' component to enable remote control platforms to learn new commands.

* Update __init__.py with the proposed changes

- Add 'supported_features' property and a constant related to the 'learn_command' functionality.
- Redefine 'async_learn_command' function as a coroutine.

* Update __init__.py

* Fix assertion error

Adding the 'supported_features' attribute generated an assertion error on the 'Demo Remote' platform. This update fixes this.

* Fix duplicated 'hass' object

This update fixes a typo that occurred at the last update.
2019-06-05 11:32:59 +02:00

97 lines
3.3 KiB
YAML

# Describes the format for available remote services
turn_on:
description: Sends the Power On Command.
fields:
entity_id:
description: Name(s) of entities to turn on.
example: 'remote.family_room'
activity:
description: Activity ID or Activity Name to start.
example: 'BedroomTV'
toggle:
description: Toggles a device.
fields:
entity_id:
description: Name(s) of entities to toggle.
example: 'remote.family_room'
turn_off:
description: Sends the Power Off Command.
fields:
entity_id:
description: Name(s) of entities to turn off.
example: 'remote.family_room'
send_command:
description: Sends a command or a list of commands to a device.
fields:
entity_id:
description: Name(s) of entities to send command from.
example: 'remote.family_room'
device:
description: Device ID to send command to.
example: '32756745'
command:
description: A single command or a list of commands to send.
example: 'Play'
num_repeats:
description: An optional value that specifies the number of times you want to repeat the command(s). If not specified, the command(s) will not be repeated.
example: '5'
delay_secs:
description: An optional value that specifies that number of seconds you want to wait in between repeated commands. If not specified, the default of 0.4 seconds will be used.
example: '0.75'
hold_secs:
description: An optional value that specifies that number of seconds you want to have it held before the release is send. If not specified, the release will be send immediately after the press.
example: '2.5'
learn_command:
description: Learns a command or a list of commands from a device.
fields:
entity_id:
description: Name(s) of entities to learn command from.
example: 'remote.bedroom'
device:
description: Device ID to learn command from.
example: 'television'
command:
description: A single command or a list of commands to learn.
example: 'Turn on'
alternative:
description: If code must be stored as alternative (useful for discrete remotes).
example: 'True'
timeout:
description: Timeout, in seconds, for the command to be learned.
example: '30'
harmony_sync:
description: Syncs the remote's configuration.
fields:
entity_id:
description: Name(s) of entities to sync.
example: 'remote.family_room'
harmony_change_channel:
description: Sends change channel command to the Harmony HUB
fields:
entity_id:
description: Name(s) of Harmony remote entities to send change channel command to
example: 'remote.family_room'
channel:
description: Channel number to change to
example: '200'
xiaomi_miio_learn_command:
description: 'Learn an IR command, press "Call Service", point the remote at the IR device, and the learned command will be shown as a notification in Overview.'
fields:
entity_id:
description: 'Name of the entity to learn command from.'
example: 'remote.xiaomi_miio'
slot:
description: 'Define the slot used to save the IR command (Value from 1 to 1000000)'
example: '1'
timeout:
description: 'Define the timeout in seconds, before which the command must be learned.'
example: '30'