Site updated at 2017-08-26 10:55:24 UTC

This commit is contained in:
Travis CI 2017-08-26 10:55:24 +00:00
parent 287fe95925
commit 005d62a223
28 changed files with 75 additions and 63 deletions

View file

@ -107,7 +107,7 @@
<span class="c"># Setup your platform inside of the event loop</span>
</code></pre>
</div>
<p>The only difference with the original parameters is that the add_entities function has been replaced by the async friendly callback <code class="highlighter-rouge">async_add_entities</code>.</p>
<p>The only difference with the original parameters is that the <code class="highlighter-rouge">add_entities</code> function has been replaced by the async friendly callback <code class="highlighter-rouge">async_add_entities</code>.</p>
<h2><a class="title-link" name="implementing-an-async-entity" href="#implementing-an-async-entity"></a> Implementing an async entity</h2>
<p>You can make your entity async friendly by converting your update method to be async. This requires the dependency of your entities to also be async friendly!</p>
<div class="language-python highlighter-rouge"><pre class="highlight"><code><span class="k">class</span> <span class="nc">MyEntity</span><span class="p">(</span><span class="n">Entity</span><span class="p">):</span>