From adfcbe905884c037a3e31a0914bf7acae346be03 Mon Sep 17 00:00:00 2001 From: Yuval Aboulafia <yuval.abou@gmail.com> Date: Mon, 9 Nov 2020 10:26:43 +0200 Subject: [PATCH] Make Jewish Calendar use DEVICE_CLASS_TIMSTAMP and remove timestamp attribute (#41397) * Added "time" attribute * Revert "Added "time" attribute" This reverts commit 8adab9b78814aa1bc2adca242278e66ee9dd0b7f. * Make DEVICE_CLASS use the DEVICE_CLASS_TIMESTAMP * Removed unix timstamp attr * keep attributes but delete the timestamp --- homeassistant/components/jewish_calendar/sensor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/jewish_calendar/sensor.py b/homeassistant/components/jewish_calendar/sensor.py index 7b3a3af9c11..6881f29b963 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): @@ -160,8 +160,6 @@ class JewishCalendarTimeSensor(JewishCalendarSensor): if self._state is None: return attrs - attrs["timestamp"] = self._state.timestamp() - return attrs def get_state(self, daytime_date, after_shkia_date, after_tzais_date): -- GitLab