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

+2 -5
View File
@@ -81,15 +81,12 @@ class Camera(Entity):
"""Return bytes of camera image."""
raise NotImplementedError()
@asyncio.coroutine
def async_camera_image(self):
"""Return bytes of camera image.
This method must be run in the event loop.
This method must be run in the event loop and returns a coroutine.
"""
image = yield from self.hass.loop.run_in_executor(
None, self.camera_image)
return image
return self.hass.loop.run_in_executor(None, self.camera_image)
@asyncio.coroutine
def handle_async_mjpeg_stream(self, request):