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
This commit is contained in:
Yuval Aboulafia 2020-11-09 10:26:43 +02:00 committed by GitHub
parent a416a9e046
commit adfcbe9058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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):