mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Correct philips_js usage of the overloaded coordinator (#66287)
This commit is contained in:
parent
4d944e35fd
commit
ad09e875a6
@ -82,7 +82,7 @@ async def async_setup_entry(
|
||||
class PhilipsTVMediaPlayer(CoordinatorEntity, MediaPlayerEntity):
|
||||
"""Representation of a Philips TV exposing the JointSpace API."""
|
||||
|
||||
_coordinator: PhilipsTVDataUpdateCoordinator
|
||||
coordinator: PhilipsTVDataUpdateCoordinator
|
||||
_attr_device_class = MediaPlayerDeviceClass.TV
|
||||
|
||||
def __init__(
|
||||
@ -91,7 +91,6 @@ class PhilipsTVMediaPlayer(CoordinatorEntity, MediaPlayerEntity):
|
||||
) -> None:
|
||||
"""Initialize the Philips TV."""
|
||||
self._tv = coordinator.api
|
||||
self._coordinator = coordinator
|
||||
self._sources = {}
|
||||
self._channels = {}
|
||||
self._supports = SUPPORT_PHILIPS_JS
|
||||
@ -125,7 +124,7 @@ class PhilipsTVMediaPlayer(CoordinatorEntity, MediaPlayerEntity):
|
||||
def supported_features(self):
|
||||
"""Flag media player features that are supported."""
|
||||
supports = self._supports
|
||||
if self._coordinator.turn_on or (
|
||||
if self.coordinator.turn_on or (
|
||||
self._tv.on and self._tv.powerstate is not None
|
||||
):
|
||||
supports |= SUPPORT_TURN_ON
|
||||
@ -170,7 +169,7 @@ class PhilipsTVMediaPlayer(CoordinatorEntity, MediaPlayerEntity):
|
||||
await self._tv.setPowerState("On")
|
||||
self._state = STATE_ON
|
||||
else:
|
||||
await self._coordinator.turn_on.async_run(self.hass, self._context)
|
||||
await self.coordinator.turn_on.async_run(self.hass, self._context)
|
||||
await self._async_update_soon()
|
||||
|
||||
async def async_turn_off(self):
|
||||
|
@ -30,7 +30,7 @@ async def async_setup_entry(
|
||||
class PhilipsTVRemote(CoordinatorEntity, RemoteEntity):
|
||||
"""Device that sends commands."""
|
||||
|
||||
_coordinator: PhilipsTVDataUpdateCoordinator
|
||||
coordinator: PhilipsTVDataUpdateCoordinator
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -63,7 +63,7 @@ class PhilipsTVRemote(CoordinatorEntity, RemoteEntity):
|
||||
if self._tv.on and self._tv.powerstate:
|
||||
await self._tv.setPowerState("On")
|
||||
else:
|
||||
await self._coordinator.turn_on.async_run(self.hass, self._context)
|
||||
await self.coordinator.turn_on.async_run(self.hass, self._context)
|
||||
self.async_write_ha_state()
|
||||
|
||||
async def async_turn_off(self, **kwargs):
|
||||
|
Loading…
x
Reference in New Issue
Block a user