Use native datetime value in Jewish Calendar sensors (#59917)
parent
3adb9e4143
commit
4e4f6ffa07
|
@ -170,10 +170,8 @@ class JewishCalendarSensor(SensorEntity):
|
|||
self._holiday_attrs: dict[str, str] = {}
|
||||
|
||||
@property
|
||||
def native_value(self) -> StateType:
|
||||
def native_value(self) -> datetime | StateType:
|
||||
"""Return the state of the sensor."""
|
||||
if isinstance(self._state, datetime):
|
||||
return self._state.isoformat()
|
||||
return self._state
|
||||
|
||||
async def async_update(self) -> None:
|
||||
|
@ -262,11 +260,11 @@ class JewishCalendarTimeSensor(JewishCalendarSensor):
|
|||
_attr_device_class = DEVICE_CLASS_TIMESTAMP
|
||||
|
||||
@property
|
||||
def native_value(self) -> StateType | None:
|
||||
def native_value(self) -> datetime | None:
|
||||
"""Return the state of the sensor."""
|
||||
if self._state is None:
|
||||
return None
|
||||
return dt_util.as_utc(self._state).isoformat()
|
||||
return dt_util.as_utc(self._state)
|
||||
|
||||
def get_state(
|
||||
self, daytime_date: HDate, after_shkia_date: HDate, after_tzais_date: HDate
|
||||
|
|
Loading…
Reference in New Issue