Cleanup coroutine threadsafe (#27080)
* Cleanup coroutine threadsafe * fix lint * Fix typing * Fix tests * Fix black
This commit is contained in:
1 parent
f4a1f2809b
commit
c1851a2d94
23 files changed
+196
-232
No files matched your search
@@ -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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user