From 4be8d5ebde211153c4f1c7a8d0ce27eeb9d5dcbd Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 27 Oct 2021 13:57:45 +0200 Subject: [PATCH] Use DeviceInfo in solarlog (#58526) Co-authored-by: epenet --- homeassistant/components/solarlog/sensor.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/solarlog/sensor.py b/homeassistant/components/solarlog/sensor.py index 5918c397a7b..d54845f8027 100644 --- a/homeassistant/components/solarlog/sensor.py +++ b/homeassistant/components/solarlog/sensor.py @@ -1,7 +1,7 @@ """Platform for solarlog sensors.""" from homeassistant.components.sensor import SensorEntity from homeassistant.helpers import update_coordinator -from homeassistant.helpers.entity import StateType +from homeassistant.helpers.entity import DeviceInfo, StateType from . import SolarlogData from .const import DOMAIN, SENSOR_TYPES, SolarLogSensorEntityDescription @@ -30,11 +30,11 @@ class SolarlogSensor(update_coordinator.CoordinatorEntity, SensorEntity): self.entity_description = description self._attr_name = f"{coordinator.name} {description.name}" self._attr_unique_id = f"{coordinator.unique_id}_{description.key}" - self._attr_device_info = { - "identifiers": {(DOMAIN, coordinator.unique_id)}, - "name": coordinator.name, - "manufacturer": "Solar-Log", - } + self._attr_device_info = DeviceInfo( + identifiers={(DOMAIN, coordinator.unique_id)}, + manufacturer="Solar-Log", + name=coordinator.name, + ) @property def native_value(self) -> StateType: