Migrate input helpers services to support translations (#96392)

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
pull/96693/head
Franck Nijhof 2023-07-12 17:12:22 +02:00 committed by GitHub
parent b39660df3b
commit d6771e6f8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 146 additions and 62 deletions

View File

@ -1,24 +1,16 @@
toggle:
name: Toggle
description: Toggle an input boolean
target:
entity:
domain: input_boolean
turn_off:
name: Turn off
description: Turn off an input boolean
target:
entity:
domain: input_boolean
turn_on:
name: Turn on
description: Turn on an input boolean
target:
entity:
domain: input_boolean
reload:
name: Reload
description: Reload the input_boolean configuration

View File

@ -17,5 +17,23 @@
}
}
}
},
"services": {
"toggle": {
"name": "Toggle",
"description": "Toggles the helper on/off."
},
"turn_off": {
"name": "Turn off",
"description": "Turns off the helper."
},
"turn_on": {
"name": "Turn on",
"description": "Turns on the helper."
},
"reload": {
"name": "Reload",
"description": "Reloads helpers from the YAML-configuration."
}
}
}

View File

@ -1,6 +1,4 @@
press:
name: Press
description: Press the input button entity.
target:
entity:
domain: input_button

View File

@ -13,5 +13,11 @@
}
}
}
},
"services": {
"press": {
"name": "Press",
"description": "Mimics the physical button press on the device."
}
}
}

View File

@ -1,33 +1,21 @@
set_datetime:
name: Set
description: This can be used to dynamically set the date and/or time.
target:
entity:
domain: input_datetime
fields:
date:
name: Date
description: The target date the entity should be set to.
example: '"2019-04-20"'
selector:
text:
time:
name: Time
description: The target time the entity should be set to.
example: '"05:04:20"'
selector:
time:
datetime:
name: Date & Time
description: The target date & time the entity should be set to.
example: '"2019-04-20 05:04:20"'
selector:
text:
timestamp:
name: Timestamp
description:
The target date & time the entity should be set to as expressed by a
UNIX timestamp.
selector:
number:
min: 0
@ -35,5 +23,3 @@ set_datetime:
mode: box
reload:
name: Reload
description: Reload the input_datetime configuration.

View File

@ -34,5 +34,33 @@
}
}
}
},
"services": {
"set_datetime": {
"name": "Set",
"description": "Sets the date and/or time.",
"fields": {
"date": {
"name": "Date",
"description": "The target date."
},
"time": {
"name": "Time",
"description": "The target time."
},
"datetime": {
"name": "Date & time",
"description": "The target date & time."
},
"timestamp": {
"name": "Timestamp",
"description": "The target date & time, expressed by a UNIX timestamp."
}
}
},
"reload": {
"name": "Reload",
"description": "Reloads helpers from the YAML-configuration."
}
}
}

View File

@ -1,27 +1,19 @@
decrement:
name: Decrement
description: Decrement the value of an input number entity by its stepping.
target:
entity:
domain: input_number
increment:
name: Increment
description: Increment the value of an input number entity by its stepping.
target:
entity:
domain: input_number
set_value:
name: Set
description: Set the value of an input number entity.
target:
entity:
domain: input_number
fields:
value:
name: Value
description: The target value the entity should be set to.
required: true
selector:
number:
@ -31,5 +23,3 @@ set_value:
mode: box
reload:
name: Reload
description: Reload the input_number configuration.

View File

@ -33,5 +33,29 @@
}
}
}
},
"services": {
"decrement": {
"name": "Decrement",
"description": "Decrements the current value by 1 step."
},
"increment": {
"name": "Increment",
"description": "Increments the value by 1 step."
},
"set_value": {
"name": "Set",
"description": "Sets the value.",
"fields": {
"value": {
"name": "Value",
"description": "The target value."
}
}
},
"reload": {
"name": "Reload",
"description": "Reloads helpers from the YAML-configuration."
}
}
}

View File

@ -1,75 +1,53 @@
select_next:
name: Next
description: Select the next options of an input select entity.
target:
entity:
domain: input_select
fields:
cycle:
name: Cycle
description: If the option should cycle from the last to the first.
default: true
selector:
boolean:
select_option:
name: Select
description: Select an option of an input select entity.
target:
entity:
domain: input_select
fields:
option:
name: Option
description: Option to be selected.
required: true
example: '"Item A"'
selector:
text:
select_previous:
name: Previous
description: Select the previous options of an input select entity.
target:
entity:
domain: input_select
fields:
cycle:
name: Cycle
description: If the option should cycle from the first to the last.
default: true
selector:
boolean:
select_first:
name: First
description: Select the first option of an input select entity.
target:
entity:
domain: input_select
select_last:
name: Last
description: Select the last option of an input select entity.
target:
entity:
domain: input_select
set_options:
name: Set options
description: Set the options of an input select entity.
target:
entity:
domain: input_select
fields:
options:
name: Options
description: Options for the input select entity.
required: true
example: '["Item A", "Item B", "Item C"]'
selector:
object:
reload:
name: Reload
description: Reload the input_select configuration.

View File

@ -16,5 +16,59 @@
}
}
}
},
"services": {
"select_next": {
"name": "Next",
"description": "Select the next option.",
"fields": {
"cycle": {
"name": "Cycle",
"description": "If the option should cycle from the last to the first option on the list."
}
}
},
"select_option": {
"name": "Select",
"description": "Selects an option.",
"fields": {
"option": {
"name": "Option",
"description": "Option to be selected."
}
}
},
"select_previous": {
"name": "Previous",
"description": "Selects the previous option.",
"fields": {
"cycle": {
"name": "[%key:component::input_select::services::select_next::fields::cycle::name%]",
"description": "[%key:component::input_select::services::select_next::fields::cycle::description%]"
}
}
},
"select_first": {
"name": "First",
"description": "Selects the first option."
},
"select_last": {
"name": "Last",
"description": "Selects the last option."
},
"set_options": {
"name": "Set options",
"description": "Sets the options.",
"fields": {
"options": {
"name": "Options",
"description": "List of options."
}
}
},
"reload": {
"name": "Reload",
"description": "Reloads helpers from the YAML-configuration."
}
}
}

View File

@ -1,18 +1,12 @@
set_value:
name: Set
description: Set the value of an input text entity.
target:
entity:
domain: input_text
fields:
value:
name: Value
description: The target value the entity should be set to.
required: true
example: This is an example text
selector:
text:
reload:
name: Reload
description: Reload the input_text configuration.

View File

@ -29,5 +29,21 @@
}
}
}
},
"services": {
"set_value": {
"name": "Set",
"description": "Sets the value.",
"fields": {
"value": {
"name": "Value",
"description": "The target value."
}
}
},
"reload": {
"name": "Reload",
"description": "Reloads helpers from the YAML-configuration."
}
}
}