mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Add translation support for utility_meter type in config flow (#86220)
* Add translation support for utility_meter type * Remove redundant labels
This commit is contained in:
parent
63bddae01d
commit
c97cf62b47
@ -35,15 +35,15 @@ from .const import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
METER_TYPES = [
|
METER_TYPES = [
|
||||||
selector.SelectOptionDict(value="none", label="No cycle"),
|
"none",
|
||||||
selector.SelectOptionDict(value=QUARTER_HOURLY, label="Every 15 minutes"),
|
QUARTER_HOURLY,
|
||||||
selector.SelectOptionDict(value=HOURLY, label="Hourly"),
|
HOURLY,
|
||||||
selector.SelectOptionDict(value=DAILY, label="Daily"),
|
DAILY,
|
||||||
selector.SelectOptionDict(value=WEEKLY, label="Weekly"),
|
WEEKLY,
|
||||||
selector.SelectOptionDict(value=MONTHLY, label="Monthly"),
|
MONTHLY,
|
||||||
selector.SelectOptionDict(value=BIMONTHLY, label="Every two months"),
|
BIMONTHLY,
|
||||||
selector.SelectOptionDict(value=QUARTERLY, label="Quarterly"),
|
QUARTERLY,
|
||||||
selector.SelectOptionDict(value=YEARLY, label="Yearly"),
|
YEARLY,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -74,7 +74,9 @@ CONFIG_SCHEMA = vol.Schema(
|
|||||||
selector.EntitySelectorConfig(domain=SENSOR_DOMAIN),
|
selector.EntitySelectorConfig(domain=SENSOR_DOMAIN),
|
||||||
),
|
),
|
||||||
vol.Required(CONF_METER_TYPE): selector.SelectSelector(
|
vol.Required(CONF_METER_TYPE): selector.SelectSelector(
|
||||||
selector.SelectSelectorConfig(options=METER_TYPES),
|
selector.SelectSelectorConfig(
|
||||||
|
options=METER_TYPES, translation_key=CONF_METER_TYPE
|
||||||
|
),
|
||||||
),
|
),
|
||||||
vol.Required(CONF_METER_OFFSET, default=0): selector.NumberSelector(
|
vol.Required(CONF_METER_OFFSET, default=0): selector.NumberSelector(
|
||||||
selector.NumberSelectorConfig(
|
selector.NumberSelectorConfig(
|
||||||
|
@ -31,5 +31,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"selector": {
|
||||||
|
"cycle": {
|
||||||
|
"options": {
|
||||||
|
"none": "No cycle",
|
||||||
|
"quarter-hourly": "Every 15 minutes",
|
||||||
|
"hourly": "Hourly",
|
||||||
|
"daily": "Daily",
|
||||||
|
"weekly": "Weekly",
|
||||||
|
"monthly": "Monthly",
|
||||||
|
"bimonthly": "Every two months",
|
||||||
|
"quarterly": "Quarterly",
|
||||||
|
"yearly": "Yearly"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,5 +31,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"title": "Utility Meter"
|
"title": "Utility Meter",
|
||||||
|
"selector": {
|
||||||
|
"cycle": {
|
||||||
|
"options": {
|
||||||
|
"none": "No cycle",
|
||||||
|
"quarter-hourly": "Every 15 minutes",
|
||||||
|
"hourly": "Hourly",
|
||||||
|
"daily": "Daily",
|
||||||
|
"weekly": "Weekly",
|
||||||
|
"monthly": "Monthly",
|
||||||
|
"bimonthly": "Every two months",
|
||||||
|
"quarterly": "Quarterly",
|
||||||
|
"yearly": "Yearly"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user