mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-06-21 15:20:00 +08:00
feat: avoid setting icon when device_class is defined (#855)
This commit is contained in:
@ -116,7 +116,7 @@ class Sensor(MIoTPropertyEntity, SensorEntity):
|
||||
if spec.state_class:
|
||||
self._attr_state_class = spec.state_class
|
||||
# Set icon
|
||||
if spec.icon:
|
||||
if spec.icon and not self.device_class:
|
||||
self._attr_icon = spec.icon
|
||||
|
||||
@property
|
||||
|
Reference in New Issue
Block a user