From 03100693b0a57ccf509cb5df9beadfb28214d535 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 28 Oct 2021 14:30:02 +0200 Subject: [PATCH] Use DeviceInfo in syncthing (#58580) Co-authored-by: epenet --- homeassistant/components/syncthing/sensor.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/syncthing/sensor.py b/homeassistant/components/syncthing/sensor.py index e88636b814b..192b4c5c395 100644 --- a/homeassistant/components/syncthing/sensor.py +++ b/homeassistant/components/syncthing/sensor.py @@ -6,6 +6,7 @@ from homeassistant.components.sensor import SensorEntity from homeassistant.core import callback from homeassistant.exceptions import PlatformNotReady from homeassistant.helpers.dispatcher import async_dispatcher_connect +from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.event import async_track_time_interval from .const import ( @@ -130,15 +131,15 @@ class FolderSensor(SensorEntity): return False @property - def device_info(self): + def device_info(self) -> DeviceInfo: """Return device information.""" - return { - "identifiers": {(DOMAIN, self._server_id)}, - "name": f"Syncthing ({self._syncthing.url})", - "manufacturer": "Syncthing Team", - "sw_version": self._version, - "entry_type": "service", - } + return DeviceInfo( + entry_type="service", + identifiers={(DOMAIN, self._server_id)}, + manufacturer="Syncthing Team", + name=f"Syncthing ({self._syncthing.url})", + sw_version=self._version, + ) async def async_update_status(self): """Request folder status and update state."""