feat: avoid setting icon when device_class is defined (#855)

This commit is contained in:
Necroneco
2025-03-12 15:17:02 +08:00
committed by GitHub
parent 5c46504d0e
commit 07cb4ed193
3 changed files with 4 additions and 9 deletions

View File

@ -88,7 +88,7 @@ class Number(MIoTPropertyEntity, NumberEntity):
if self.spec.external_unit:
self._attr_native_unit_of_measurement = self.spec.external_unit
# Set icon
if self.spec.icon:
if self.spec.icon and not self.device_class:
self._attr_icon = self.spec.icon
# Set value range
if self._value_range: