mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Make Switch as x platform options translatable (#130443)
Make Switch as x options translatable
This commit is contained in:
parent
a97090e0d5
commit
a1e3c7513b
@ -18,12 +18,12 @@ from homeassistant.helpers.schema_config_entry_flow import (
|
||||
from .const import CONF_INVERT, CONF_TARGET_DOMAIN, DOMAIN
|
||||
|
||||
TARGET_DOMAIN_OPTIONS = [
|
||||
selector.SelectOptionDict(value=Platform.COVER, label="Cover"),
|
||||
selector.SelectOptionDict(value=Platform.FAN, label="Fan"),
|
||||
selector.SelectOptionDict(value=Platform.LIGHT, label="Light"),
|
||||
selector.SelectOptionDict(value=Platform.LOCK, label="Lock"),
|
||||
selector.SelectOptionDict(value=Platform.SIREN, label="Siren"),
|
||||
selector.SelectOptionDict(value=Platform.VALVE, label="Valve"),
|
||||
Platform.COVER,
|
||||
Platform.FAN,
|
||||
Platform.LIGHT,
|
||||
Platform.LOCK,
|
||||
Platform.SIREN,
|
||||
Platform.VALVE,
|
||||
]
|
||||
|
||||
CONFIG_FLOW = {
|
||||
@ -35,7 +35,9 @@ CONFIG_FLOW = {
|
||||
),
|
||||
vol.Optional(CONF_INVERT, default=False): selector.BooleanSelector(),
|
||||
vol.Required(CONF_TARGET_DOMAIN): selector.SelectSelector(
|
||||
selector.SelectSelectorConfig(options=TARGET_DOMAIN_OPTIONS),
|
||||
selector.SelectSelectorConfig(
|
||||
options=TARGET_DOMAIN_OPTIONS, translation_key="target_domain"
|
||||
),
|
||||
),
|
||||
}
|
||||
)
|
||||
|
@ -26,5 +26,17 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"selector": {
|
||||
"target_domain": {
|
||||
"options": {
|
||||
"cover": "[%key:component::cover::title%]",
|
||||
"fan": "[%key:component::fan::title%]",
|
||||
"light": "[%key:component::light::title%]",
|
||||
"lock": "[%key:component::lock::title%]",
|
||||
"siren": "[%key:component::siren::title%]",
|
||||
"valve": "[%key:component::valve::title%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user