provide default icon

This commit is contained in:
Erik 2016-02-04 21:55:22 +01:00
parent a33f1c61e5
commit f3b74079e0

View File

@ -59,6 +59,15 @@ class TimeDateSensor(Entity):
""" Returns the state of the device. """
return self._state
@property
def icon(self):
if "date" in self.type and "time" in self.type:
return "mdi:calendar-clock"
elif "date" in self.type:
return "mdi:calendar"
else:
return "mdi:clock"
def update(self):
""" Gets the latest data and updates the states. """