Migrate Demo translations (#83294)
This commit is contained in:
parent
aa4a0df194
commit
f801fe307e
4 changed files with 26 additions and 13 deletions
|
@ -25,13 +25,13 @@ async def async_setup_platform(
|
||||||
unique_id="speed",
|
unique_id="speed",
|
||||||
name="Speed",
|
name="Speed",
|
||||||
icon="mdi:speedometer",
|
icon="mdi:speedometer",
|
||||||
device_class="demo__speed",
|
|
||||||
current_option="ridiculous_speed",
|
current_option="ridiculous_speed",
|
||||||
options=[
|
options=[
|
||||||
"light_speed",
|
"light_speed",
|
||||||
"ridiculous_speed",
|
"ridiculous_speed",
|
||||||
"ludicrous_speed",
|
"ludicrous_speed",
|
||||||
],
|
],
|
||||||
|
translation_key="speed",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -56,17 +56,17 @@ class DemoSelect(SelectEntity):
|
||||||
unique_id: str,
|
unique_id: str,
|
||||||
name: str,
|
name: str,
|
||||||
icon: str,
|
icon: str,
|
||||||
device_class: str | None,
|
|
||||||
current_option: str | None,
|
current_option: str | None,
|
||||||
options: list[str],
|
options: list[str],
|
||||||
|
translation_key: str,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the Demo select entity."""
|
"""Initialize the Demo select entity."""
|
||||||
self._attr_unique_id = unique_id
|
self._attr_unique_id = unique_id
|
||||||
self._attr_name = name or DEVICE_DEFAULT_NAME
|
self._attr_name = name or DEVICE_DEFAULT_NAME
|
||||||
self._attr_current_option = current_option
|
self._attr_current_option = current_option
|
||||||
self._attr_icon = icon
|
self._attr_icon = icon
|
||||||
self._attr_device_class = device_class
|
|
||||||
self._attr_options = options
|
self._attr_options = options
|
||||||
|
self._attr_translation_key = translation_key
|
||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, unique_id)},
|
identifiers={(DOMAIN, unique_id)},
|
||||||
name=name,
|
name=name,
|
||||||
|
|
|
@ -63,6 +63,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"entity": {
|
"entity": {
|
||||||
|
"select": {
|
||||||
|
"speed": {
|
||||||
|
"state": {
|
||||||
|
"light_speed": "Light Speed",
|
||||||
|
"ludicrous_speed": "Ludicrous Speed",
|
||||||
|
"ridiculous_speed": "Ridiculous Speed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"sensor": {
|
"sensor": {
|
||||||
"thermostat_mode": {
|
"thermostat_mode": {
|
||||||
"state": {
|
"state": {
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"state": {
|
|
||||||
"demo__speed": {
|
|
||||||
"light_speed": "Light Speed",
|
|
||||||
"ludicrous_speed": "Ludicrous Speed",
|
|
||||||
"ridiculous_speed": "Ridiculous Speed"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,14 @@
|
||||||
{
|
{
|
||||||
"entity": {
|
"entity": {
|
||||||
|
"select": {
|
||||||
|
"speed": {
|
||||||
|
"state": {
|
||||||
|
"light_speed": "Light Speed",
|
||||||
|
"ludicrous_speed": "Ludicrous Speed",
|
||||||
|
"ridiculous_speed": "Ridiculous Speed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"sensor": {
|
"sensor": {
|
||||||
"thermostat_mode": {
|
"thermostat_mode": {
|
||||||
"state": {
|
"state": {
|
||||||
|
@ -27,7 +36,8 @@
|
||||||
"fix_flow": {
|
"fix_flow": {
|
||||||
"abort": {
|
"abort": {
|
||||||
"not_tea_time": "Can not re-heat the tea at this time"
|
"not_tea_time": "Can not re-heat the tea at this time"
|
||||||
}
|
},
|
||||||
|
"step": {}
|
||||||
},
|
},
|
||||||
"title": "The tea is cold"
|
"title": "The tea is cold"
|
||||||
},
|
},
|
||||||
|
@ -53,6 +63,9 @@
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"step": {
|
"step": {
|
||||||
|
"init": {
|
||||||
|
"data": {}
|
||||||
|
},
|
||||||
"options_1": {
|
"options_1": {
|
||||||
"data": {
|
"data": {
|
||||||
"bool": "Optional boolean",
|
"bool": "Optional boolean",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue