From e99bef7b6e8506690023aa3fe4d9bd21b8773f3e Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 28 Oct 2021 09:41:07 +0200 Subject: [PATCH] Use DeviceInfo in songpal (#58574) Co-authored-by: epenet --- .../components/songpal/media_player.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/songpal/media_player.py b/homeassistant/components/songpal/media_player.py index 1746d5ece0d..b13ca99cd5b 100644 --- a/homeassistant/components/songpal/media_player.py +++ b/homeassistant/components/songpal/media_player.py @@ -32,6 +32,7 @@ from homeassistant.helpers import ( device_registry as dr, entity_platform, ) +from homeassistant.helpers.entity import DeviceInfo from .const import CONF_ENDPOINT, DOMAIN, SET_SOUND_SETTING @@ -205,16 +206,16 @@ class SongpalEntity(MediaPlayerEntity): return self._sysinfo.macAddr @property - def device_info(self): + def device_info(self) -> DeviceInfo: """Return the device info.""" - return { - "connections": {(dr.CONNECTION_NETWORK_MAC, self._sysinfo.macAddr)}, - "identifiers": {(DOMAIN, self.unique_id)}, - "manufacturer": "Sony Corporation", - "name": self.name, - "sw_version": self._sysinfo.version, - "model": self._model, - } + return DeviceInfo( + connections={(dr.CONNECTION_NETWORK_MAC, self._sysinfo.macAddr)}, + identifiers={(DOMAIN, self.unique_id)}, + manufacturer="Sony Corporation", + model=self._model, + name=self.name, + sw_version=self._sysinfo.version, + ) @property def available(self):