Merge pull request #1127 from molobrakos/timedate

provide default icon
This commit is contained in:
Paulus Schoutsen 2016-02-04 13:04:09 -08:00
commit 6149e509c3

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. """