From 8e62fc254a28b7bf1dd5fdc064367718d6a1ee91 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 27 Oct 2021 13:16:59 +0200 Subject: [PATCH] Use DeviceInfo in sms (#58525) Co-authored-by: epenet --- homeassistant/components/sms/sensor.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/sms/sensor.py b/homeassistant/components/sms/sensor.py index d405c817656..f5152ac7462 100644 --- a/homeassistant/components/sms/sensor.py +++ b/homeassistant/components/sms/sensor.py @@ -5,6 +5,7 @@ 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.helpers.entity import DeviceInfo from .const import DOMAIN, SMS_GATEWAY @@ -39,10 +40,10 @@ class GSMSignalSensor(SensorEntity): def __init__(self, hass, gateway, imei, description): """Initialize the GSM Signal sensor.""" - self._attr_device_info = { - "identifiers": {(DOMAIN, str(imei))}, - "name": "SMS Gateway", - } + self._attr_device_info = DeviceInfo( + identifiers={(DOMAIN, str(imei))}, + name="SMS Gateway", + ) self._attr_unique_id = str(imei) self._hass = hass self._gateway = gateway