Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
a90781fe23
1 değiştirilmiş dosya ile 1 ekleme ve 4 silme
  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 = (
             self._config.name
             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