mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 12:45:28 +02:00
Added "time" attribute
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user