Skip to content

Commit

Permalink
Update switch attributes and translations
Browse files Browse the repository at this point in the history
Signed-off-by: Serge Arbuzov <info@whitediver.com>
  • Loading branch information
Arbuzov committed Nov 12, 2023
1 parent 671c3a3 commit dc25578
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/delonghi_primadonna/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
14 changes: 14 additions & 0 deletions custom_components/delonghi_primadonna/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
14 changes: 14 additions & 0 deletions custom_components/delonghi_primadonna/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@
"power_on": {
"name": "Включить"
}
},
"switch": {
"cup_light": {
"name": "Подсветка чашки"
},
"debug_notification": {
"name": "Отладочные уведомления"
},
"energy_save_mode": {
"name": "Энергосбережение"
},
"sounds": {
"name": "Звук кнопок"
}
}
}
}

0 comments on commit dc25578

Please sign in to comment.