11 Commits

Author SHA1 Message Date
Franck Nijhof
08884e2cca
Collection of fixes and improvements (#516) 2020-05-11 08:12:01 -07:00
Pascal Vizeli
9e76c5897a
Add warning for call async function from a thread (#409)
* Add warning for call async function from a thread

* Update docs/asyncio_working_with_async.md

Co-Authored-By: Aaron Bach <bachya1208@gmail.com>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Aaron Bach <bachya1208@gmail.com>
2020-02-18 10:53:13 -08:00
Ville Skyttä
770185004b
Code block improvements (#382)
* Use f-strings instead of .format()

* Code block language marker fixes

* Make example code blocks syntactically valid Python

* Run all python code blocks through black

https://github.com/scop/misc/blob/master/black_markdown.py

* Add some missing code block language markers

* Use shell language consistently to mark shell code blocks

* Undo folding of some example dicts

* Remove outdated OrderedDict comments per Python 3.7, replace with plain dict
2020-01-13 21:55:41 +02:00
carstenschroeder
17c6ca6c71 use the builtin asyncio function run_coroutine_threadsafe (#210)
This asyncio util function is legacy from when we ran Python 3.4.
2019-03-29 16:53:27 -07:00
Kacper Krupa
467496522a 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!
2018-11-24 10:39:26 +01:00
Paulus Schoutsen
b13c07bad4
Use correct method to run coroutines threadsafe 2018-09-15 17:56:21 +02:00
Paulus Schoutsen
dfcbf9a891 Update async docs 2018-07-24 16:19:43 +02:00
Paulus Schoutsen
873db57e30 Wrap up 2018-04-25 15:28:06 -04:00
Paulus Schoutsen
9311326aec Remove unused header 2018-04-24 15:44:32 -04:00
Paulus Schoutsen
632bc81a20 Fix all headers 2018-04-24 11:46:45 -04:00
Paulus Schoutsen
746e35b7a7 Migrate to Docusaurus 2018-04-24 09:52:18 -04:00