From 6736ed67ba83491a66555e1073d407c5ba086007 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Wed, 31 May 2023 03:23:47 +0200 Subject: [PATCH] Translate config flow for sensor measurement option in group (#87374) * Translate config flow * reset en * Delete en.json --- homeassistant/components/group/config_flow.py | 24 +++++++++++-------- homeassistant/components/group/strings.json | 14 +++++++++++ 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/group/config_flow.py b/homeassistant/components/group/config_flow.py index 53a8fd06264..6cdc47f9e85 100644 --- a/homeassistant/components/group/config_flow.py +++ b/homeassistant/components/group/config_flow.py @@ -24,14 +24,14 @@ from .binary_sensor import CONF_ALL from .const import CONF_HIDE_MEMBERS, CONF_IGNORE_NON_NUMERIC _STATISTIC_MEASURES = [ - selector.SelectOptionDict(value="min", label="Minimum"), - selector.SelectOptionDict(value="max", label="Maximum"), - selector.SelectOptionDict(value="mean", label="Arithmetic mean"), - selector.SelectOptionDict(value="median", label="Median"), - selector.SelectOptionDict(value="last", label="Most recently updated"), - selector.SelectOptionDict(value="range", label="Statistical range"), - selector.SelectOptionDict(value="sum", label="Sum"), - selector.SelectOptionDict(value="product", label="Product"), + "min", + "max", + "mean", + "median", + "last", + "range", + "sum", + "product", ] @@ -80,13 +80,17 @@ BINARY_SENSOR_CONFIG_SCHEMA = basic_group_config_schema("binary_sensor").extend( SENSOR_CONFIG_EXTENDS = { vol.Required(CONF_TYPE): selector.SelectSelector( - selector.SelectSelectorConfig(options=_STATISTIC_MEASURES), + selector.SelectSelectorConfig( + options=_STATISTIC_MEASURES, translation_key=CONF_TYPE + ), ), } SENSOR_OPTIONS = { vol.Optional(CONF_IGNORE_NON_NUMERIC, default=False): selector.BooleanSelector(), vol.Required(CONF_TYPE): selector.SelectSelector( - selector.SelectSelectorConfig(options=_STATISTIC_MEASURES), + selector.SelectSelectorConfig( + options=_STATISTIC_MEASURES, translation_key=CONF_TYPE + ), ), } diff --git a/homeassistant/components/group/strings.json b/homeassistant/components/group/strings.json index 9f505454681..192823cef65 100644 --- a/homeassistant/components/group/strings.json +++ b/homeassistant/components/group/strings.json @@ -176,5 +176,19 @@ } } } + }, + "selector": { + "type": { + "options": { + "min": "Minimum", + "max": "Maximum", + "mean": "Arithmetic mean", + "median": "Median", + "last": "Most recently updated", + "range": "Statistical range", + "sum": "Sum", + "product": "Product" + } + } } }