From a90781fe23329c7dfe6f87805d4055cc69545315 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sun, 29 Dec 2024 10:23:07 +0900 Subject: [PATCH] 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 --- custom_components/tuya_local/helpers/mixin.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/custom_components/tuya_local/helpers/mixin.py b/custom_components/tuya_local/helpers/mixin.py index 7470517e67..511e6835ec 100644 --- a/custom_components/tuya_local/helpers/mixin.py +++ b/custom_components/tuya_local/helpers/mixin.py @@ -60,10 +60,7 @@ def use_device_name(self): 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