Просмотр исходного кода

Entity naming: modify logic for use_device_name

Last change seems to have made things worse, as lights are now getting
None appended as well, even with no class or translation_key.

Issue #1856
Jason Rumney 1 год назад
Родитель
Сommit
a90781fe23
1 измененных файлов с 1 добавлено и 4 удалено
  1. 1 4
      custom_components/tuya_local/helpers/mixin.py

+ 1 - 4
custom_components/tuya_local/helpers/mixin.py

@@ -60,10 +60,7 @@ class TuyaLocalEntity:
         own_name = (
         own_name = (
             self._config.name
             self._config.name
             or self._config.translation_key
             or self._config.translation_key
-            or (
-                self._default_to_device_class_name
-                and not self._config.translation_only_key
-            )
+            or (self._default_to_device_class_name and self._config.device_class)
         )
         )
         return not own_name
         return not own_name