From f801fe307e5f6ef95b7213a44faee4f4b1344484 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 5 Dec 2022 14:44:26 +0100 Subject: [PATCH] Migrate Demo translations (#83294) --- homeassistant/components/demo/select.py | 6 +++--- homeassistant/components/demo/strings.json | 9 +++++++++ homeassistant/components/demo/strings.select.json | 9 --------- .../components/demo/translations/en.json | 15 ++++++++++++++- 4 files changed, 26 insertions(+), 13 deletions(-) delete mode 100644 homeassistant/components/demo/strings.select.json diff --git a/homeassistant/components/demo/select.py b/homeassistant/components/demo/select.py index 683008abdbc..e30d65c9f0e 100644 --- a/homeassistant/components/demo/select.py +++ b/homeassistant/components/demo/select.py @@ -25,13 +25,13 @@ async def async_setup_platform( unique_id="speed", name="Speed", icon="mdi:speedometer", - device_class="demo__speed", current_option="ridiculous_speed", options=[ "light_speed", "ridiculous_speed", "ludicrous_speed", ], + translation_key="speed", ), ] ) @@ -56,17 +56,17 @@ class DemoSelect(SelectEntity): unique_id: str, name: str, icon: str, - device_class: str | None, current_option: str | None, options: list[str], + translation_key: str, ) -> None: """Initialize the Demo select entity.""" self._attr_unique_id = unique_id self._attr_name = name or DEVICE_DEFAULT_NAME self._attr_current_option = current_option self._attr_icon = icon - self._attr_device_class = device_class self._attr_options = options + self._attr_translation_key = translation_key self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, unique_id)}, name=name, diff --git a/homeassistant/components/demo/strings.json b/homeassistant/components/demo/strings.json index b01cace6ede..2b90cf37d39 100644 --- a/homeassistant/components/demo/strings.json +++ b/homeassistant/components/demo/strings.json @@ -63,6 +63,15 @@ } }, "entity": { + "select": { + "speed": { + "state": { + "light_speed": "Light Speed", + "ludicrous_speed": "Ludicrous Speed", + "ridiculous_speed": "Ridiculous Speed" + } + } + }, "sensor": { "thermostat_mode": { "state": { diff --git a/homeassistant/components/demo/strings.select.json b/homeassistant/components/demo/strings.select.json deleted file mode 100644 index f797ab562bc..00000000000 --- a/homeassistant/components/demo/strings.select.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "state": { - "demo__speed": { - "light_speed": "Light Speed", - "ludicrous_speed": "Ludicrous Speed", - "ridiculous_speed": "Ridiculous Speed" - } - } -} diff --git a/homeassistant/components/demo/translations/en.json b/homeassistant/components/demo/translations/en.json index fc6fd97d91f..524f4658ee3 100644 --- a/homeassistant/components/demo/translations/en.json +++ b/homeassistant/components/demo/translations/en.json @@ -1,5 +1,14 @@ { "entity": { + "select": { + "speed": { + "state": { + "light_speed": "Light Speed", + "ludicrous_speed": "Ludicrous Speed", + "ridiculous_speed": "Ridiculous Speed" + } + } + }, "sensor": { "thermostat_mode": { "state": { @@ -27,7 +36,8 @@ "fix_flow": { "abort": { "not_tea_time": "Can not re-heat the tea at this time" - } + }, + "step": {} }, "title": "The tea is cold" }, @@ -53,6 +63,9 @@ }, "options": { "step": { + "init": { + "data": {} + }, "options_1": { "data": { "bool": "Optional boolean",