mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Update template.py
This commit is contained in:
parent
513c2b03c9
commit
fb34f94d9c
@ -221,7 +221,7 @@ class LightTemplate(Light):
|
|||||||
self.hass.async_add_job(self._level_script.async_run(
|
self.hass.async_add_job(self._level_script.async_run(
|
||||||
{"brightness": kwargs[ATTR_BRIGHTNESS]}))
|
{"brightness": kwargs[ATTR_BRIGHTNESS]}))
|
||||||
else:
|
else:
|
||||||
self.hass.async_add_job(self._on_script.async_run())
|
yield from self._on_script.async_run()
|
||||||
|
|
||||||
if optimistic_set:
|
if optimistic_set:
|
||||||
self.async_schedule_update_ha_state()
|
self.async_schedule_update_ha_state()
|
||||||
@ -229,7 +229,7 @@ class LightTemplate(Light):
|
|||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_turn_off(self, **kwargs):
|
def async_turn_off(self, **kwargs):
|
||||||
"""Turn the light off."""
|
"""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:
|
if self._template is None:
|
||||||
self._state = False
|
self._state = False
|
||||||
self.async_schedule_update_ha_state()
|
self.async_schedule_update_ha_state()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user