From fb7bab2a5db35f53495d4ecd34cb6200c3bc4ef8 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 9 Dec 2021 09:20:56 +0100 Subject: [PATCH] Use new SensorDeviceClass in cert_expiry (#61331) Co-authored-by: epenet --- homeassistant/components/cert_expiry/sensor.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/cert_expiry/sensor.py b/homeassistant/components/cert_expiry/sensor.py index 0aa67993180..bad82289017 100644 --- a/homeassistant/components/cert_expiry/sensor.py +++ b/homeassistant/components/cert_expiry/sensor.py @@ -5,14 +5,13 @@ from datetime import datetime, timedelta import voluptuous as vol -from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity -from homeassistant.config_entries import SOURCE_IMPORT -from homeassistant.const import ( - CONF_HOST, - CONF_PORT, - DEVICE_CLASS_TIMESTAMP, - EVENT_HOMEASSISTANT_START, +from homeassistant.components.sensor import ( + PLATFORM_SCHEMA, + SensorDeviceClass, + SensorEntity, ) +from homeassistant.config_entries import SOURCE_IMPORT +from homeassistant.const import CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_START from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeassistant.helpers.event import async_call_later @@ -78,7 +77,7 @@ class CertExpiryEntity(CoordinatorEntity): class SSLCertificateTimestamp(CertExpiryEntity, SensorEntity): """Implementation of the Cert Expiry timestamp sensor.""" - _attr_device_class = DEVICE_CLASS_TIMESTAMP + _attr_device_class = SensorDeviceClass.TIMESTAMP def __init__(self, coordinator) -> None: """Initialize a Cert Expiry timestamp sensor."""