From f3b74079e0f132222a4da4beb584146bf8fc2484 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 4 Feb 2016 21:55:22 +0100 Subject: [PATCH] provide default icon --- homeassistant/components/sensor/time_date.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/homeassistant/components/sensor/time_date.py b/homeassistant/components/sensor/time_date.py index 4fff93fd2c0..4e63384a8ac 100644 --- a/homeassistant/components/sensor/time_date.py +++ b/homeassistant/components/sensor/time_date.py @@ -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. """