Cleanup coroutine threadsafe (#27080)

* Cleanup coroutine threadsafe

* fix lint

* Fix typing

* Fix tests

* Fix black
This commit is contained in:
Pascal Vizeli authored and GitHub committed 2019-10-01 16:59:06 +02:00
1 parent f4a1f2809b
commit c1851a2d94
23 files changed
+196 -232

No files matched your search

+1 -2
View File
@@ -26,7 +26,6 @@ from homeassistant.components.camera import (
)
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers import config_validation as cv
from homeassistant.util.async_ import run_coroutine_threadsafe
_LOGGER = logging.getLogger(__name__)
@@ -105,7 +104,7 @@ class GenericCamera(Camera):
def camera_image(self):
"""Return bytes of camera image."""
return run_coroutine_threadsafe(
return asyncio.run_coroutine_threadsafe(
self.async_camera_image(), self.hass.loop
).result()