Pass context to on/off scripts (#40254)

This commit is contained in:
Joakim Plate 2020-10-13 12:13:47 +02:00 committed by GitHub
parent 2d08708c3b
commit 11bbc14530
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -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):