diff --git a/custom_components/pandora_cas/binary_sensor.py b/custom_components/pandora_cas/binary_sensor.py index 04ee7cc..ae55c23 100644 --- a/custom_components/pandora_cas/binary_sensor.py +++ b/custom_components/pandora_cas/binary_sensor.py @@ -186,6 +186,11 @@ def is_on(self) -> bool: """Return the state of the binary sensor.""" return self._state + @property + def translation_key(self): + """Return the translation key to translate the entity's name and states.""" + return self.device_class + # pylint: disable=attribute-defined-outside-init @callback def _update_callback(self, force=False): diff --git a/custom_components/pandora_cas/manifest.json b/custom_components/pandora_cas/manifest.json index 0394587..dabe5a8 100644 --- a/custom_components/pandora_cas/manifest.json +++ b/custom_components/pandora_cas/manifest.json @@ -8,5 +8,5 @@ "iot_class": "cloud_polling", "issue_tracker": "https://github.com/turbulator/pandora-cas/issues", "requirements": [], - "version": "1.4.5" + "version": "1.4.6" } diff --git a/custom_components/pandora_cas/translations/binary_sensor.ru.json b/custom_components/pandora_cas/translations/binary_sensor.ru.json deleted file mode 100644 index f96e837..0000000 --- a/custom_components/pandora_cas/translations/binary_sensor.ru.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "state": { - "pandora_cas__engine": {"off": "Заглушен", "on": "Работает"}, - "pandora_cas__door_male": {"off": "Закрыт", "on": "Открыт"}, - "pandora_cas__moving": {"off": "Неподвижно", "on": "В движении"}, - "pandora_cas__guard": {"off": "Под охраной", "on": "Снято с охраны"} - } -} diff --git a/custom_components/pandora_cas/translations/en.json b/custom_components/pandora_cas/translations/en.json index b010972..a1bd632 100644 --- a/custom_components/pandora_cas/translations/en.json +++ b/custom_components/pandora_cas/translations/en.json @@ -49,4 +49,4 @@ } } } -} \ No newline at end of file +} diff --git a/custom_components/pandora_cas/translations/ru.json b/custom_components/pandora_cas/translations/ru.json index de7f9b1..1731105 100644 --- a/custom_components/pandora_cas/translations/ru.json +++ b/custom_components/pandora_cas/translations/ru.json @@ -48,5 +48,33 @@ "description": "Задайте параметры для {name}" } } + }, + "entity": { + "binary_sensor": { + "pandora_cas__engine": { + "state": { + "off": "Заглушен", + "on": "Работает" + } + }, + "pandora_cas__door_male": { + "state": { + "off": "Закрыт", + "on": "Открыт" + } + }, + "pandora_cas__moving": { + "state": { + "off": "Неподвижен", + "on": "В движении" + } + }, + "pandora_cas__guard": { + "state": { + "off": "Под охраной", + "on": "Снято с охраны" + } + } + } } -} \ No newline at end of file +}