Improve min_max translation strings (#69248)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Erik Montnemery 2022-04-04 17:55:09 +02:00 committed by GitHub
parent 7f1d10dcca
commit 8222b783a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 7 deletions

View File

@ -16,7 +16,14 @@ from homeassistant.helpers.schema_config_entry_flow import (
from .const import CONF_ENTITY_IDS, CONF_ROUND_DIGITS, DOMAIN
_STATISTIC_MEASURES = ["last", "max", "mean", "min", "median"]
_STATISTIC_MEASURES = [
{"value": "min", "label": "Minimum"},
{"value": "max", "label": "Maximum"},
{"value": "mean", "label": "Arithmetic mean"},
{"value": "median", "label": "Median"},
{"value": "last", "label": "Most recently updated"},
]
OPTIONS_SCHEMA = vol.Schema(
{

View File

@ -3,24 +3,30 @@
"config": {
"step": {
"user": {
"description": "Precision controls the number of decimal digits when the statistics characteristic is mean or median.",
"title": "Add min / max / mean / median sensor",
"description": "Create a sensor that calculates a min, max, mean or median value from a list of input sensors.",
"data": {
"entity_ids": "Input entities",
"name": "Name",
"round_digits": "Precision",
"type": "Statistic characteristic"
},
"data_description": {
"round_digits": "Controls the number of decimal digits in the output when the statistics characteristic is mean or median."
}
}
}
},
"options": {
"step": {
"options": {
"description": "[%key:component::min_max::config::step::user::description%]",
"init": {
"data": {
"entity_ids": "[%key:component::min_max::config::step::user::data::entity_ids%]",
"round_digits": "[%key:component::min_max::config::step::user::data::round_digits%]",
"type": "[%key:component::min_max::config::step::user::data::type%]"
},
"data_description": {
"round_digits": "[%key:component::min_max::config::step::user::data_description::round_digits%]"
}
}
}

View File

@ -8,19 +8,25 @@
"round_digits": "Precision",
"type": "Statistic characteristic"
},
"description": "Precision controls the number of decimal digits when the statistics characteristic is mean or median."
"data_description": {
"round_digits": "Controls the number of decimal digits in the output when the statistics characteristic is mean or median."
},
"description": "Create a sensor that calculates a min, max, mean or median value from a list of input sensors.",
"title": "Add min / max / mean / median sensor"
}
}
},
"options": {
"step": {
"options": {
"init": {
"data": {
"entity_ids": "Input entities",
"round_digits": "Precision",
"type": "Statistic characteristic"
},
"description": "Precision controls the number of decimal digits when the statistics characteristic is mean or median."
"data_description": {
"round_digits": "Controls the number of decimal digits in the output when the statistics characteristic is mean or median."
}
}
}
},