mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
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:
parent
a416a9e046
commit
adfcbe9058
@ -3,7 +3,7 @@ import logging
|
|||||||
|
|
||||||
import hdate
|
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.entity import Entity
|
||||||
from homeassistant.helpers.sun import get_astral_event_date
|
from homeassistant.helpers.sun import get_astral_event_date
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
@ -150,7 +150,7 @@ class JewishCalendarTimeSensor(JewishCalendarSensor):
|
|||||||
@property
|
@property
|
||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""Return the class of this sensor."""
|
"""Return the class of this sensor."""
|
||||||
return "timestamp"
|
return DEVICE_CLASS_TIMESTAMP
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
@ -160,8 +160,6 @@ class JewishCalendarTimeSensor(JewishCalendarSensor):
|
|||||||
if self._state is None:
|
if self._state is None:
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
attrs["timestamp"] = self._state.timestamp()
|
|
||||||
|
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
def get_state(self, daytime_date, after_shkia_date, after_tzais_date):
|
def get_state(self, daytime_date, after_shkia_date, after_tzais_date):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user