Pass context to on/off scripts (#40254)
This commit is contained in:
parent
2d08708c3b
commit
11bbc14530
3 changed files with 4 additions and 4 deletions
|
@ -96,7 +96,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
class PhilipsTVMediaPlayer(MediaPlayerEntity):
|
||||
"""Representation of a Philips TV exposing the JointSpace API."""
|
||||
|
||||
def __init__(self, tv, name, on_script):
|
||||
def __init__(self, tv: PhilipsTV, name: str, on_script: Script):
|
||||
"""Initialize the Philips TV."""
|
||||
self._tv = tv
|
||||
self._name = name
|
||||
|
@ -193,7 +193,7 @@ class PhilipsTVMediaPlayer(MediaPlayerEntity):
|
|||
def turn_on(self):
|
||||
"""Turn on the device."""
|
||||
if self._on_script:
|
||||
self._on_script.run()
|
||||
self._on_script.run(context=self._context)
|
||||
self._update_soon(DELAY_ACTION_ON)
|
||||
|
||||
def turn_off(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue