Site updated at 2016-11-05 16:10:14 UTC

This commit is contained in:
Travis CI 2016-11-05 16:10:14 +00:00
parent c5a9b05115
commit 4a22946601
496 changed files with 7661 additions and 7043 deletions

View file

@ -118,6 +118,21 @@
</code></pre>
</div>
<h2><a class="title-link" name="important-template-rules" href="#important-template-rules"></a> Important Template Rules</h2>
<p>There are a few very important rules to remember when writing automation templates:</p>
<ol>
<li>You <strong><em>must</em></strong> use <code class="highlighter-rouge">data_template</code> in place of <code class="highlighter-rouge">data</code> when using templates in the <code class="highlighter-rouge">data</code> section of a service call.</li>
<li>You <strong><em>must</em></strong> use <code class="highlighter-rouge">service_template</code> in place of <code class="highlighter-rouge">service</code> when using templates in the <code class="highlighter-rouge">service</code> section of a service call.</li>
<li>You <strong><em>must</em></strong> surround single-line templates with double quotes (<code class="highlighter-rouge">"</code>) or single quotes (<code class="highlighter-rouge">'</code>).</li>
<li>It is advised that you prepare for undefined variables by using <code class="highlighter-rouge">if ... is not none</code> or the <a href="http://jinja.pocoo.org/docs/dev/templates/#default"><code class="highlighter-rouge">default</code> filter</a>, or both.</li>
<li>It is advised that when comparing numbers, you convert the number(s) to a <a href="http://jinja.pocoo.org/docs/dev/templates/#float"><code class="highlighter-rouge">float</code></a> or an <a href="http://jinja.pocoo.org/docs/dev/templates/#int"><code class="highlighter-rouge">int</code></a> by using the respective <a href="http://jinja.pocoo.org/docs/dev/templates/#list-of-builtin-filters">filter</a>.</li>
<li>While the <a href="http://jinja.pocoo.org/docs/dev/templates/#float"><code class="highlighter-rouge">float</code></a> and <a href="http://jinja.pocoo.org/docs/dev/templates/#int"><code class="highlighter-rouge">int</code></a> filters do allow a default fallback value if the conversion is unsuccessful, they do not provide the ability to catch undefined variables.</li>
</ol>
<p>Remembering these simple rules will help save you from many headaches and endless hours of frustration when using automation templates.</p>
<h2><a class="title-link" name="available-trigger-data" href="#available-trigger-data"></a> Available Trigger Data</h2>
<p>The following tables show the available trigger data per platform.</p>