Use SensorDeviceClass in jewish-calendar (#61827)

This commit is contained in:
epenet 2021-12-14 22:12:34 +01:00 committed by GitHub
parent 158ff601b6
commit 002512f4ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,8 +8,12 @@ from typing import Any
from hdate import HDate
from hdate.zmanim import Zmanim
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
from homeassistant.const import DEVICE_CLASS_TIMESTAMP, SUN_EVENT_SUNSET
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
)
from homeassistant.const import SUN_EVENT_SUNSET
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.sun import get_astral_event_date
@ -255,7 +259,7 @@ class JewishCalendarSensor(SensorEntity):
class JewishCalendarTimeSensor(JewishCalendarSensor):
"""Implement attrbutes for sensors returning times."""
_attr_device_class = DEVICE_CLASS_TIMESTAMP
_attr_device_class = SensorDeviceClass.TIMESTAMP
def get_state(
self, daytime_date: HDate, after_shkia_date: HDate, after_tzais_date: HDate