Skip to content

Commit

Permalink
Use default translations for entities that can be named by its device…
Browse files Browse the repository at this point in the history
… class
  • Loading branch information
caibinqing committed Aug 12, 2024
1 parent f7f44a0 commit 61029c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/xiaomi_gateway3/hass/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ def __init__(self, device: "XDevice", conv: "BaseConv"):
else:
self.entity_id = f"{conv.domain}.{device.uid}_{conv.attr}"

if self._default_to_device_class_name() and str(self.device_class) == conv.attr:
delattr(self, "_attr_name")

self.on_init()

@cached_property
Expand Down

0 comments on commit 61029c7

Please sign in to comment.