From 8adab9b78814aa1bc2adca242278e66ee9dd0b7f Mon Sep 17 00:00:00 2001 From: Yuval Aboulafia Date: Wed, 7 Oct 2020 14:25:13 +0300 Subject: [PATCH] Added "time" attribute --- homeassistant/components/jewish_calendar/sensor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/jewish_calendar/sensor.py b/homeassistant/components/jewish_calendar/sensor.py index 7b3a3af9c11..f85ffce2a87 100644 --- a/homeassistant/components/jewish_calendar/sensor.py +++ b/homeassistant/components/jewish_calendar/sensor.py @@ -3,7 +3,7 @@ import logging import hdate -from homeassistant.const import SUN_EVENT_SUNSET +from homeassistant.const import DEVICE_CLASS_TIMESTAMP, SUN_EVENT_SUNSET from homeassistant.helpers.entity import Entity from homeassistant.helpers.sun import get_astral_event_date import homeassistant.util.dt as dt_util @@ -150,7 +150,7 @@ class JewishCalendarTimeSensor(JewishCalendarSensor): @property def device_class(self): """Return the class of this sensor.""" - return "timestamp" + return DEVICE_CLASS_TIMESTAMP @property def device_state_attributes(self): @@ -161,6 +161,7 @@ class JewishCalendarTimeSensor(JewishCalendarSensor): return attrs attrs["timestamp"] = self._state.timestamp() + attrs["time"] = self._state.strftime("%H:%M") return attrs