mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-08-29 06:08:09 +02:00
Fixed sensor icons
This commit is contained in:
parent
e8c2c4bd1e
commit
b026c18cbc
1 changed files with 9 additions and 4 deletions
|
@ -358,7 +358,12 @@ class MikrotikControllerSensor(Entity):
|
||||||
|
|
||||||
self._device_class = None
|
self._device_class = None
|
||||||
self._state = None
|
self._state = None
|
||||||
|
|
||||||
|
if ATTR_ICON in self._type:
|
||||||
|
self._icon = self._type[ATTR_ICON]
|
||||||
|
else:
|
||||||
self._icon = None
|
self._icon = None
|
||||||
|
|
||||||
self._unit_of_measurement = None
|
self._unit_of_measurement = None
|
||||||
self._attrs = {ATTR_ATTRIBUTION: ATTRIBUTION}
|
self._attrs = {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||||
|
|
||||||
|
@ -384,9 +389,9 @@ class MikrotikControllerSensor(Entity):
|
||||||
@property
|
@property
|
||||||
def icon(self) -> str:
|
def icon(self) -> str:
|
||||||
"""Return the icon."""
|
"""Return the icon."""
|
||||||
if ATTR_ICON in self._type:
|
if self._icon:
|
||||||
return self._icon
|
return self._icon
|
||||||
else:
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue