Migrate Demo translations (#83294)

This commit is contained in:
Franck Nijhof 2022-12-05 14:44:26 +01:00 committed by GitHub
parent aa4a0df194
commit f801fe307e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 13 deletions

View file

@ -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,