mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Set has_entity_name in kodi (#94604)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
fa9c31d3db
commit
cc53e4e6c1
@ -259,6 +259,8 @@ def cmd(
|
||||
class KodiEntity(MediaPlayerEntity):
|
||||
"""Representation of a XBMC/Kodi device."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_name = None
|
||||
_attr_supported_features = (
|
||||
MediaPlayerEntityFeature.BROWSE_MEDIA
|
||||
| MediaPlayerEntityFeature.NEXT_TRACK
|
||||
@ -290,7 +292,11 @@ class KodiEntity(MediaPlayerEntity):
|
||||
self._media_position = None
|
||||
self._connect_error = False
|
||||
|
||||
self._attr_name = name
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers={(DOMAIN, uid)},
|
||||
manufacturer="Kodi",
|
||||
name=name,
|
||||
)
|
||||
|
||||
def _reset_state(self, players=None):
|
||||
self._players = players
|
||||
@ -368,15 +374,6 @@ class KodiEntity(MediaPlayerEntity):
|
||||
"""Return the unique id of the device."""
|
||||
return self._unique_id
|
||||
|
||||
@property
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Return device info for this device."""
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, self.unique_id)},
|
||||
manufacturer="Kodi",
|
||||
name=self.name,
|
||||
)
|
||||
|
||||
@property
|
||||
def state(self) -> MediaPlayerState:
|
||||
"""Return the state of the device."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user