mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-28 19:50:06 +02:00
added icons into types definition file for binary sensors
This commit is contained in:
parent
8b2f75a0ff
commit
167469b7d1
2 changed files with 13 additions and 1 deletions
|
@ -317,6 +317,15 @@ class MikrotikControllerBinarySensor(BinarySensorEntity):
|
|||
"""Return true if device is on."""
|
||||
return self._data[self.entity_description.data_is_on]
|
||||
|
||||
@property
|
||||
def icon(self) -> str:
|
||||
"""Return the icon."""
|
||||
if self.entity_description.icon_enabled:
|
||||
if self._data[self.entity_description.data_is_on]:
|
||||
return self.entity_description.icon_enabled
|
||||
else:
|
||||
return self.entity_description.icon_disabled
|
||||
|
||||
@property
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Return a description for device registry."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue