1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Cleanup coroutine threadsafe (#27080)

* Cleanup coroutine threadsafe

* fix lint

* Fix typing

* Fix tests

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

View File

@@ -9,7 +9,6 @@ from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.const import CONF_ENTITY_ID, CONF_NAME, CONF_MODE
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_validation as cv
from homeassistant.util.async_ import run_coroutine_threadsafe
import homeassistant.util.dt as dt_util
_LOGGER = logging.getLogger(__name__)
@@ -220,7 +219,7 @@ class ProxyCamera(Camera):
def camera_image(self):
"""Return camera image."""
return run_coroutine_threadsafe(
return asyncio.run_coroutine_threadsafe(
self.async_camera_image(), self.hass.loop
).result()