Fix schema and strings in template switch (#121843)

pull/121858/head
G Johansson 2024-07-12 15:50:21 +02:00 committed by GitHub
parent 12384104f4
commit 1acbcf921a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -136,7 +136,7 @@ def generate_schema(domain: str, flow_type: str) -> vol.Schema:
if domain == Platform.SWITCH:
schema |= {
vol.Required(CONF_VALUE_TEMPLATE): selector.TemplateSelector(),
vol.Optional(CONF_VALUE_TEMPLATE): selector.TemplateSelector(),
vol.Optional(CONF_TURN_ON): selector.ActionSelector(),
vol.Optional(CONF_TURN_OFF): selector.ActionSelector(),
}

View File

@ -68,7 +68,7 @@
"name": "[%key:common::config_flow::data::name%]",
"turn_off": "Actions on turn off",
"turn_on": "Actions on turn on",
"state": "[%key:component::template::config::step::sensor::data::state%]"
"value_template": "Value template"
},
"data_description": {
"device_id": "[%key:component::template::config::step::sensor::data_description::device_id%]"
@ -127,7 +127,7 @@
"data": {
"device_id": "[%key:common::config_flow::data::device%]",
"name": "[%key:common::config_flow::data::name%]",
"state": "[%key:component::template::config::step::sensor::data::state%]",
"value_template": "[%key:component::template::config::step::switch::data::value_template%]",
"turn_off": "[%key:component::template::config::step::switch::data::turn_off%]",
"turn_on": "[%key:component::template::config::step::switch::data::turn_on%]"
},

View File

@ -63,7 +63,7 @@ PLATFORM_SCHEMA = SWITCH_PLATFORM_SCHEMA.extend(
SWICTH_CONFIG_SCHEMA = vol.Schema(
{
vol.Required(CONF_NAME): cv.template,
vol.Required(CONF_VALUE_TEMPLATE): cv.template,
vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
vol.Optional(CONF_TURN_ON): selector.ActionSelector(),
vol.Optional(CONF_TURN_OFF): selector.ActionSelector(),
vol.Optional(CONF_DEVICE_ID): selector.DeviceSelector(),