From dc255786c0e5a509e87b9c30bc01a176f5eee785 Mon Sep 17 00:00:00 2001 From: Serge Arbuzov Date: Sun, 12 Nov 2023 17:18:17 +0300 Subject: [PATCH] Update switch attributes and translations Signed-off-by: Serge Arbuzov --- custom_components/delonghi_primadonna/switch.py | 8 ++++---- .../delonghi_primadonna/translations/en.json | 14 ++++++++++++++ .../delonghi_primadonna/translations/ru.json | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/custom_components/delonghi_primadonna/switch.py b/custom_components/delonghi_primadonna/switch.py index bd23901..50ce54c 100644 --- a/custom_components/delonghi_primadonna/switch.py +++ b/custom_components/delonghi_primadonna/switch.py @@ -30,9 +30,9 @@ async def async_setup_entry( class DelongiPrimadonnaCupLightSwitch(DelonghiDeviceEntity, ToggleEntity): """This switch enable/disable the cup light""" - _attr_name = 'Cups light' _attr_is_on = False _attr_icon = 'mdi:lightbulb' + _attr_translation_key = 'cup_light' @property def entity_category(self, **kwargs: Any) -> None: @@ -55,9 +55,9 @@ class DelongiPrimadonnaNotificationSwitch(DelonghiDeviceEntity, ToggleEntity): on device status change used for debug purposes """ - _attr_name = 'Enable notification' _attr_is_on = False _attr_icon = 'mdi:magnify-expand' + _attr_translation_key = 'debug_notification' @property def is_on(self, **kwargs: Any) -> None: @@ -80,9 +80,9 @@ async def async_turn_off(self, **kwargs: Any) -> None: class DelongiPrimadonnaPowerSaveSwitch(DelonghiDeviceEntity, ToggleEntity): - _attr_name = 'Enable power save' _attr_is_on = False _attr_icon = 'mdi:lightning-bolt' + _attr_translation_key = 'energy_save_mode' @property def entity_category(self, **kwargs: Any) -> None: @@ -102,9 +102,9 @@ async def async_turn_off(self, **kwargs: Any) -> None: class DelongiPrimadonnaSoundsSwitch(DelonghiDeviceEntity, ToggleEntity): - _attr_name = 'Enable sound' _attr_is_on = False _attr_icon = 'mdi:volume-high' + _attr_translation_key = 'sounds' @property def entity_category(self, **kwargs: Any) -> None: diff --git a/custom_components/delonghi_primadonna/translations/en.json b/custom_components/delonghi_primadonna/translations/en.json index a94a7f2..d8751a7 100644 --- a/custom_components/delonghi_primadonna/translations/en.json +++ b/custom_components/delonghi_primadonna/translations/en.json @@ -39,6 +39,20 @@ "power_on": { "name": "Turn on" } + }, + "switch": { + "cup_light": { + "name": "Cup light" + }, + "debug_notification": { + "name": "Debug notification" + }, + "energy_save_mode": { + "name": "Energy save mode" + }, + "sounds": { + "name": "Sounds" + } } } } \ No newline at end of file diff --git a/custom_components/delonghi_primadonna/translations/ru.json b/custom_components/delonghi_primadonna/translations/ru.json index d15778b..68866b6 100644 --- a/custom_components/delonghi_primadonna/translations/ru.json +++ b/custom_components/delonghi_primadonna/translations/ru.json @@ -39,6 +39,20 @@ "power_on": { "name": "Включить" } + }, + "switch": { + "cup_light": { + "name": "Подсветка чашки" + }, + "debug_notification": { + "name": "Отладочные уведомления" + }, + "energy_save_mode": { + "name": "Энергосбережение" + }, + "sounds": { + "name": "Звук кнопок" + } } } } \ No newline at end of file