When both name and class are missing, but translation_key is available, use that for the unique_id before defaulting to the entity type only. Preparation for wider use of translated names. Issue #1579
@@ -267,7 +267,8 @@ class TuyaEntityConfig:
own_name = self._config.get("name", self.device_class)
if own_name:
return f"{self.entity}_{slugify(own_name)}"
-
+ if self.translation_key:
+ return f"{self.entity}_{self.translation_key}"
return self.entity
@property