Skip to content

Commit

Permalink
Include translations for Russian language
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 ea20652 commit 8d11c13
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom_components/delonghi_primadonna/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class DelongiPrimadonnaPowerButton(DelonghiDeviceEntity, ButtonEntity):
"""This button turns on the device"""

_attr_name = 'Turn on ECAM'
_attr_translation_key = 'power_on'

async def async_press(self):
self.hass.async_create_task(self.device.power_on())
5 changes: 5 additions & 0 deletions custom_components/delonghi_primadonna/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ProfileSelect(DelonghiDeviceEntity, SelectEntity):
_attr_options = list(AVAILABLE_PROFILES.keys())
_attr_current_option = list(AVAILABLE_PROFILES.keys())[0]
_attr_entity_category = EntityCategory.CONFIG
_attr_translation_key = 'profile'

@property
def entity_category(self, **kwargs: Any) -> None:
Expand All @@ -57,6 +58,7 @@ class BeverageSelect(DelonghiDeviceEntity, SelectEntity):
_attr_name = 'Beverage'
_attr_options = [*AvailableBeverage]
_attr_current_option = [*AvailableBeverage][0]
_attr_translation_key = 'beverage'

async def async_select_option(self, option: str) -> None:
"""Select beverage action"""
Expand All @@ -69,6 +71,7 @@ class EnergySaveModeSelect(DelonghiDeviceEntity, SelectEntity):
_attr_name = 'Energy Save Mode'
_attr_options = list(POWER_OFF_OPTIONS.keys())
_attr_current_option = list(POWER_OFF_OPTIONS.keys())[3]
_attr_translation_key = 'energy_save_mode'

@property
def entity_category(self, **kwargs: Any) -> None:
Expand All @@ -90,6 +93,7 @@ class WaterHardnessSelect(DelonghiDeviceEntity, SelectEntity):
_attr_name = 'Water Hardness'
_attr_options = ['Soft', 'Medium', 'Hard', 'Very Hard']
_attr_current_option = 'Soft'
_attr_translation_key = 'water_hardness'

@property
def entity_category(self, **kwargs: Any) -> None:
Expand All @@ -111,6 +115,7 @@ class WaterTemperatureSelect(DelonghiDeviceEntity, SelectEntity):
_attr_name = 'Water Temperature'
_attr_options = ['Low', 'Medium', 'High', 'Highest']
_attr_current_option = 'Low'
_attr_translation_key = 'water_temperature'

@property
def entity_category(self, **kwargs: Any) -> None:
Expand Down
24 changes: 24 additions & 0 deletions custom_components/delonghi_primadonna/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,29 @@
}
}
}
},
"entity": {
"select": {
"profile": {
"name": "Профиль"
},
"beverage": {
"name": "Напиток"
},
"energy_save_mode": {
"name": "Aвтоотключение"
},
"water_hardness": {
"name": "Жесткость воды"
},
"water_temperature": {
"name": "Температура воды"
}
},
"button":{
"power_on": {
"name": "Включить"
}
}
}
}

0 comments on commit 8d11c13

Please sign in to comment.