Use DeviceInfo in volumio (#58619)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/58628/head
epenet 2021-10-28 18:25:40 +02:00 committed by GitHub
parent 8ed4e500d3
commit 1c7fbb7540
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 8 deletions

View File

@ -31,6 +31,7 @@ from homeassistant.const import (
STATE_PAUSED,
STATE_PLAYING,
)
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.util import Throttle
from .browse_media import browse_node, browse_top_level
@ -99,15 +100,15 @@ class Volumio(MediaPlayerEntity):
return self._name
@property
def device_info(self):
def device_info(self) -> DeviceInfo:
"""Return device info for this device."""
return {
"identifiers": {(DOMAIN, self.unique_id)},
"name": self.name,
"manufacturer": "Volumio",
"sw_version": self._info["systemversion"],
"model": self._info["hardware"],
}
return DeviceInfo(
identifiers={(DOMAIN, self.unique_id)},
manufacturer="Volumio",
model=self._info["hardware"],
name=self.name,
sw_version=self._info["systemversion"],
)
@property
def media_content_type(self):