From fb34f94d9c15c34f1ad8a390baafd16d4c980989 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 1 Nov 2017 14:20:29 +0100 Subject: [PATCH] Update template.py --- homeassistant/components/light/template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/light/template.py b/homeassistant/components/light/template.py index d8aa93c3db1..465e84fae90 100644 --- a/homeassistant/components/light/template.py +++ b/homeassistant/components/light/template.py @@ -221,7 +221,7 @@ class LightTemplate(Light): self.hass.async_add_job(self._level_script.async_run( {"brightness": kwargs[ATTR_BRIGHTNESS]})) else: - self.hass.async_add_job(self._on_script.async_run()) + yield from self._on_script.async_run() if optimistic_set: self.async_schedule_update_ha_state() @@ -229,7 +229,7 @@ class LightTemplate(Light): @asyncio.coroutine def async_turn_off(self, **kwargs): """Turn the light off.""" - self.hass.async_add_job(self._off_script.async_run()) + yield from self._off_script.async_run() if self._template is None: self._state = False self.async_schedule_update_ha_state()