Skip to content

Commit

Permalink
Revert "Entity naming: use device name if translation_key is device c…
Browse files Browse the repository at this point in the history
…lass"

This reverts commit 065ece9.
Issue #1856

This change interferes with sensor naming.

I'm not sure why the sensor naming based on class translations is
working, but switches are not in #1856
  • Loading branch information
make-all committed Jul 15, 2024
1 parent 1a09663 commit 8528f3e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions custom_components/tuya_local/helpers/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ def name(self):
@property
def use_device_name(self):
"""Return whether to use the device name for the entity name"""
alt_name = self._config.translation_key
if self._config.translation_key is self._config.device_class:
alt_name = None
own_name = self._config.name or alt_name
own_name = self._config.name or self._config.translation_key
return not own_name

@property
Expand Down

0 comments on commit 8528f3e

Please sign in to comment.