From b13c07bad4f4e2071dfd012bc8e614355c64fae8 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 15 Sep 2018 17:56:21 +0200 Subject: [PATCH] Use correct method to run coroutines threadsafe --- docs/asyncio_working_with_async.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/asyncio_working_with_async.md b/docs/asyncio_working_with_async.md index de6d0f9d..075f903b 100644 --- a/docs/asyncio_working_with_async.md +++ b/docs/asyncio_working_with_async.md @@ -74,10 +74,10 @@ Sometimes it will happen that you’re in a thread and you want to call a functi In the following example, `say_hello` will schedule `async_say_hello` and block till the function has run and get the result back. ```python -from homeassistant.util.async_ import run_callback_threadsafe +from homeassistant.util.async_ import run_coroutine_threadsafe def say_hello(hass, target): - return run_callback_threadsafe( + return run_coroutine_threadsafe( hass.loop, async_say_hello, target).result() async def async_say_hello(hass, target):