Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions custom_components/ps3/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class MediaPlayer(MediaPlayerEntity, CoordinatorEntity):

def __init__(self, coordinator, turn_on_script, service_registry, mac_address):
super().__init__(coordinator)
self._device_class = "receiver"
self._turn_on_script = turn_on_script
self._service_registry = service_registry
self._attr_supported_features = (
Expand All @@ -42,11 +43,15 @@ def __init__(self, coordinator, turn_on_script, service_registry, mac_address):
| (MediaPlayerEntityFeature.TURN_ON if turn_on_script is not None else 0)
)
self._mac_address = mac_address

@property
def name(self):
return "PS3"

@property
def device_class(self):
return self._device_class

@property
def media_content_id(self):
if self.coordinator.data is not None:
Expand Down Expand Up @@ -210,4 +215,4 @@ async def wait_with_timeout(self):
except (asyncio.TimeoutError, aiohttp.client_exceptions.ClientConnectorError) as e:
raise HomeAssistantError(e)

await self.coordinator.async_refresh()
await self.coordinator.async_refresh()