mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Add translations for type select selector min_max config and option flow (#86213)
* Add translations for type select selector min_max * Remove redundant labels
This commit is contained in:
parent
14d3911bfd
commit
1b4fda2321
@ -19,13 +19,13 @@ from homeassistant.helpers.schema_config_entry_flow import (
|
|||||||
from .const import CONF_ENTITY_IDS, CONF_ROUND_DIGITS, DOMAIN
|
from .const import CONF_ENTITY_IDS, CONF_ROUND_DIGITS, DOMAIN
|
||||||
|
|
||||||
_STATISTIC_MEASURES = [
|
_STATISTIC_MEASURES = [
|
||||||
selector.SelectOptionDict(value="min", label="Minimum"),
|
"min",
|
||||||
selector.SelectOptionDict(value="max", label="Maximum"),
|
"max",
|
||||||
selector.SelectOptionDict(value="mean", label="Arithmetic mean"),
|
"mean",
|
||||||
selector.SelectOptionDict(value="median", label="Median"),
|
"median",
|
||||||
selector.SelectOptionDict(value="last", label="Most recently updated"),
|
"last",
|
||||||
selector.SelectOptionDict(value="range", label="Statistical range"),
|
"range",
|
||||||
selector.SelectOptionDict(value="sum", label="Sum"),
|
"sum",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -38,7 +38,9 @@ OPTIONS_SCHEMA = vol.Schema(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
vol.Required(CONF_TYPE): selector.SelectSelector(
|
vol.Required(CONF_TYPE): selector.SelectSelector(
|
||||||
selector.SelectSelectorConfig(options=_STATISTIC_MEASURES),
|
selector.SelectSelectorConfig(
|
||||||
|
options=_STATISTIC_MEASURES, translation_key=CONF_TYPE
|
||||||
|
),
|
||||||
),
|
),
|
||||||
vol.Required(CONF_ROUND_DIGITS, default=2): selector.NumberSelector(
|
vol.Required(CONF_ROUND_DIGITS, default=2): selector.NumberSelector(
|
||||||
selector.NumberSelectorConfig(
|
selector.NumberSelectorConfig(
|
||||||
|
@ -30,5 +30,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"selector": {
|
||||||
|
"type": {
|
||||||
|
"options": {
|
||||||
|
"min": "Minimum",
|
||||||
|
"max": "Maximum",
|
||||||
|
"mean": "Arithmetic mean",
|
||||||
|
"median": "Median",
|
||||||
|
"last": "Most recently updated",
|
||||||
|
"range": "Statistical range",
|
||||||
|
"sum": "Sum"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,5 +30,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"title": "Combine the state of several sensors"
|
"title": "Combine the state of several sensors",
|
||||||
|
"selector": {
|
||||||
|
"type": {
|
||||||
|
"options":{
|
||||||
|
"min": "Minimum",
|
||||||
|
"max": "Maximum",
|
||||||
|
"mean": "Arithmetic mean",
|
||||||
|
"median": "Median",
|
||||||
|
"last": "Most recently updated",
|
||||||
|
"range": "Statistical range",
|
||||||
|
"sum": "Sum"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user