From 467496522ab68c7eca4af38990321d981197f605 Mon Sep 17 00:00:00 2001 From: Kacper Krupa Date: Sat, 24 Nov 2018 10:39:26 +0100 Subject: [PATCH] Fixed example for run_coroutine_threadsafe util (#148) Based on the detailed docs `run_coroutine_threadsafe` have 2 params now: `coro` and `loop`, so the example is kinda wrong I think. Reference: https://dev-docs.home-assistant.io/en/master/api/util.html#homeassistant.util.async_.run_coroutine_threadsafe I've ran the example code and it seems to work correct, the previous version raised `TypeError('A coroutine object is required')`. Thanks! --- docs/asyncio_working_with_async.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/asyncio_working_with_async.md b/docs/asyncio_working_with_async.md index 075f903b..36016411 100644 --- a/docs/asyncio_working_with_async.md +++ b/docs/asyncio_working_with_async.md @@ -78,7 +78,7 @@ from homeassistant.util.async_ import run_coroutine_threadsafe def say_hello(hass, target): return run_coroutine_threadsafe( - hass.loop, async_say_hello, target).result() + async_say_hello(hass, target), hass.loop).result() async def async_say_hello(hass, target): return "Hello {}!".format(target)