Async reduce coro (#5001)

* Asyncio coro reduce

* Replace comments
This commit is contained in:
Pascal Vizeli authored and Paulus Schoutsen committed 2016-12-26 14:10:23 +01:00
1 parent 22d1bf0acd
commit 244cdf43d0
6 files changed
+47 -36

No files matched your search

+5 -2
View File
@@ -149,6 +149,9 @@ class RemoteDevice(ToggleEntity):
raise NotImplementedError()
def async_send_command(self, **kwargs):
"""Send a command to a device."""
yield from self.hass.loop.run_in_executor(
"""Send a command to a device.
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.loop.run_in_executor(
None, ft.partial(self.send_command, **kwargs))