From 31394d5758085c7637ffaad1cb1e97f886b7c1bb Mon Sep 17 00:00:00 2001 From: epenet Date: Mon, 20 Dec 2021 09:06:36 +0000 Subject: [PATCH] Use new enums in sms --- homeassistant/components/sms/sensor.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/sms/sensor.py b/homeassistant/components/sms/sensor.py index f5152ac74625da..c51d1ef8773f81 100644 --- a/homeassistant/components/sms/sensor.py +++ b/homeassistant/components/sms/sensor.py @@ -3,8 +3,12 @@ import gammu # pylint: disable=import-error -from homeassistant.components.sensor import SensorEntity, SensorEntityDescription -from homeassistant.const import DEVICE_CLASS_SIGNAL_STRENGTH, SIGNAL_STRENGTH_DECIBELS +from homeassistant.components.sensor import ( + SensorDeviceClass, + SensorEntity, + SensorEntityDescription, +) +from homeassistant.const import SIGNAL_STRENGTH_DECIBELS from homeassistant.helpers.entity import DeviceInfo from .const import DOMAIN, SMS_GATEWAY @@ -25,7 +29,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): SensorEntityDescription( key="signal", name=f"gsm_signal_imei_{imei}", - device_class=DEVICE_CLASS_SIGNAL_STRENGTH, + device_class=SensorDeviceClass.SIGNAL_STRENGTH, native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS, entity_registry_enabled_default=False, ),