Skip to content
Snippets Groups Projects
Unverified Commit 1acbcf92 authored by G Johansson's avatar G Johansson Committed by GitHub
Browse files

Fix schema and strings in template switch (#121843)

parent 12384104
No related branches found
No related tags found
No related merge requests found
......@@ -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(),
}
......
......@@ -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%]"
},
......
......@@ -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(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment