Fix typo in Template switch (#121856)
This commit is contained in:
parent
df85067cae
commit
62b9b34561
1 changed files with 3 additions and 3 deletions
|
@ -60,7 +60,7 @@ PLATFORM_SCHEMA = SWITCH_PLATFORM_SCHEMA.extend(
|
|||
{vol.Required(CONF_SWITCHES): cv.schema_with_slug_keys(SWITCH_SCHEMA)}
|
||||
)
|
||||
|
||||
SWICTH_CONFIG_SCHEMA = vol.Schema(
|
||||
SWITCH_CONFIG_SCHEMA = vol.Schema(
|
||||
{
|
||||
vol.Required(CONF_NAME): cv.template,
|
||||
vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
|
||||
|
@ -109,7 +109,7 @@ async def async_setup_entry(
|
|||
"""Initialize config entry."""
|
||||
_options = dict(config_entry.options)
|
||||
_options.pop("template_type")
|
||||
validated_config = SWICTH_CONFIG_SCHEMA(_options)
|
||||
validated_config = SWITCH_CONFIG_SCHEMA(_options)
|
||||
async_add_entities(
|
||||
[SwitchTemplate(hass, None, validated_config, config_entry.entry_id)]
|
||||
)
|
||||
|
@ -120,7 +120,7 @@ def async_create_preview_switch(
|
|||
hass: HomeAssistant, name: str, config: dict[str, Any]
|
||||
) -> SwitchTemplate:
|
||||
"""Create a preview switch."""
|
||||
validated_config = SWICTH_CONFIG_SCHEMA(config | {CONF_NAME: name})
|
||||
validated_config = SWITCH_CONFIG_SCHEMA(config | {CONF_NAME: name})
|
||||
return SwitchTemplate(hass, None, validated_config, None)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue