mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +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
|
from .const import CONF_INVERT, CONF_TARGET_DOMAIN, DOMAIN
|
||||||
|
|
||||||
TARGET_DOMAIN_OPTIONS = [
|
TARGET_DOMAIN_OPTIONS = [
|
||||||
selector.SelectOptionDict(value=Platform.COVER, label="Cover"),
|
Platform.COVER,
|
||||||
selector.SelectOptionDict(value=Platform.FAN, label="Fan"),
|
Platform.FAN,
|
||||||
selector.SelectOptionDict(value=Platform.LIGHT, label="Light"),
|
Platform.LIGHT,
|
||||||
selector.SelectOptionDict(value=Platform.LOCK, label="Lock"),
|
Platform.LOCK,
|
||||||
selector.SelectOptionDict(value=Platform.SIREN, label="Siren"),
|
Platform.SIREN,
|
||||||
selector.SelectOptionDict(value=Platform.VALVE, label="Valve"),
|
Platform.VALVE,
|
||||||
]
|
]
|
||||||
|
|
||||||
CONFIG_FLOW = {
|
CONFIG_FLOW = {
|
||||||
@ -35,7 +35,9 @@ CONFIG_FLOW = {
|
|||||||
),
|
),
|
||||||
vol.Optional(CONF_INVERT, default=False): selector.BooleanSelector(),
|
vol.Optional(CONF_INVERT, default=False): selector.BooleanSelector(),
|
||||||
vol.Required(CONF_TARGET_DOMAIN): selector.SelectSelector(
|
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