Migrate remote services to support translations (#96410)

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
pull/96693/head
Franck Nijhof 2023-07-12 18:06:31 +02:00 committed by GitHub
parent 06adace7ca
commit 80eb4747ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 86 additions and 38 deletions

View File

@ -1,15 +1,11 @@
# Describes the format for available remote services
turn_on:
name: Turn On
description: Sends the Power On Command.
target:
entity:
domain: remote
fields:
activity:
name: Activity
description: Activity ID or Activity Name to start.
example: "BedroomTV"
filter:
supported_features:
@ -18,50 +14,36 @@ turn_on:
text:
toggle:
name: Toggle
description: Toggles a device.
target:
entity:
domain: remote
turn_off:
name: Turn Off
description: Sends the Power Off Command.
target:
entity:
domain: remote
send_command:
name: Send Command
description: Sends a command or a list of commands to a device.
target:
entity:
domain: remote
fields:
device:
name: Device
description: Device ID to send command to.
example: "32756745"
selector:
text:
command:
name: Command
description: A single command or a list of commands to send.
required: true
example: "Play"
selector:
object:
num_repeats:
name: Repeats
description: The number of times you want to repeat the command(s).
default: 1
selector:
number:
min: 0
max: 255
delay_secs:
name: Delay Seconds
description: The time you want to wait in between repeated commands.
default: 0.4
selector:
number:
@ -70,8 +52,6 @@ send_command:
step: 0.1
unit_of_measurement: seconds
hold_secs:
name: Hold Seconds
description: The time you want to have it held before the release is send.
default: 0
selector:
number:
@ -81,27 +61,19 @@ send_command:
unit_of_measurement: seconds
learn_command:
name: Learn Command
description: Learns a command or a list of commands from a device.
target:
entity:
domain: remote
fields:
device:
name: Device
description: Device ID to learn command from.
example: "television"
selector:
text:
command:
name: Command
description: A single command or a list of commands to learn.
example: "Turn on"
selector:
object:
command_type:
name: Command Type
description: The type of command to be learned.
default: "ir"
selector:
select:
@ -109,13 +81,9 @@ learn_command:
- "ir"
- "rf"
alternative:
name: Alternative
description: If code must be stored as alternative (useful for discrete remotes).
selector:
boolean:
timeout:
name: Timeout
description: Timeout for the command to be learned.
selector:
number:
min: 0
@ -124,21 +92,15 @@ learn_command:
unit_of_measurement: seconds
delete_command:
name: Delete Command
description: Deletes a command or a list of commands from the database.
target:
entity:
domain: remote
fields:
device:
name: Device
description: Name of the device from which commands will be deleted.
example: "television"
selector:
text:
command:
name: Command
description: A single command or a list of commands to delete.
required: true
example: "Mute"
selector:

View File

@ -24,5 +24,91 @@
"on": "[%key:common::state::on%]"
}
}
},
"services": {
"turn_on": {
"name": "Turn on",
"description": "Sends the power on command.",
"fields": {
"activity": {
"name": "Activity",
"description": "Activity ID or activity name to be started."
}
}
},
"toggle": {
"name": "Toggle",
"description": "Toggles a device on/off."
},
"turn_off": {
"name": "Turn off",
"description": "Turns the device off."
},
"send_command": {
"name": "Send command",
"description": "Sends a command or a list of commands to a device.",
"fields": {
"device": {
"name": "Device",
"description": "Device ID to send command to."
},
"command": {
"name": "Command",
"description": "A single command or a list of commands to send."
},
"num_repeats": {
"name": "Repeats",
"description": "The number of times you want to repeat the commands."
},
"delay_secs": {
"name": "Delay seconds",
"description": "The time you want to wait in between repeated commands."
},
"hold_secs": {
"name": "Hold seconds",
"description": "The time you want to have it held before the release is send."
}
}
},
"learn_command": {
"name": "Learn command",
"description": "Learns a command or a list of commands from a device.",
"fields": {
"device": {
"name": "Device",
"description": "Device ID to learn command from."
},
"command": {
"name": "Command",
"description": "A single command or a list of commands to learn."
},
"command_type": {
"name": "Command type",
"description": "The type of command to be learned."
},
"alternative": {
"name": "Alternative",
"description": "If code must be stored as an alternative. This is useful for discrete codes. Discrete codes are used for toggles that only perform one function. For example, a code to only turn a device on. If it is on already, sending the code won't change the state."
},
"timeout": {
"name": "Timeout",
"description": "Timeout for the command to be learned."
}
}
},
"delete_command": {
"name": "Delete command",
"description": "Deletes a command or a list of commands from the database.",
"fields": {
"device": {
"name": "Device",
"description": "Device from which commands will be deleted."
},
"command": {
"name": "Command",
"description": "The single command or the list of commands to be deleted."
}
}
}
}
}