diff --git a/custom_components/xiaomi_gateway3/hass/entity.py b/custom_components/xiaomi_gateway3/hass/entity.py index e49a9f9a..166dbfdf 100644 --- a/custom_components/xiaomi_gateway3/hass/entity.py +++ b/custom_components/xiaomi_gateway3/hass/entity.py @@ -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