Add context to scripts run by template entities (#17329)

This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2018-10-15 11:38:49 +02:00
1 parent 0bf10b0b09
commit ac79ff9e24
5 files changed
+26 -21

No files matched your search

+2 -2
View File
@@ -151,11 +151,11 @@ class SwitchTemplate(SwitchDevice):
async def async_turn_on(self, **kwargs):
"""Fire the on action."""
await self._on_script.async_run()
await self._on_script.async_run(context=self._context)
async def async_turn_off(self, **kwargs):
"""Fire the off action."""
await self._off_script.async_run()
await self._off_script.async_run(context=self._context)
async def async_update(self):
"""Update the state from the template."""