WIP: Cleanup async stuff on templates (#10275)

Cleanup async stuff on templates
This commit is contained in:
Pascal Vizeli authored and GitHub committed 2017-11-01 15:48:09 +01:00
1 parent 4da8ec0a05
commit f463f4d8c6
2 files changed
+7 -5

No files matched your search

+6 -4
View File
@@ -152,13 +152,15 @@ class SwitchTemplate(SwitchDevice):
"""Return the entity_picture to use in the frontend, if any."""
return self._entity_picture
def turn_on(self, **kwargs):
@asyncio.coroutine
def async_turn_on(self, **kwargs):
"""Fire the on action."""
self._on_script.run()
yield from self._on_script.async_run()
def turn_off(self, **kwargs):
@asyncio.coroutine
def async_turn_off(self, **kwargs):
"""Fire the off action."""
self._off_script.run()
yield from self._off_script.async_run()
@asyncio.coroutine
def async_update(self):