Add icon
This commit is contained in:
1 parent
a5db23afa4
commit
6bf4532608
2 files changed
+12
No files matched your search
@@ -14,6 +14,7 @@ from homeassistant.helpers.entity import Entity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
DEFAULT_NAME = "Worldclock Sensor"
|
||||
ICON = 'mdi:clock'
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
@@ -54,6 +55,11 @@ class WorldClockSensor(Entity):
|
||||
""" Returns the state of the device. """
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
""" Icon to use in the frontend, if any. """
|
||||
return ICON
|
||||
|
||||
def update(self):
|
||||
""" Gets the time and updates the states. """
|
||||
self._state = dt_util.datetime_to_time_str(
|
||||
|
||||
Reference in new issue
Block a user