Rule Examples/en: различия между версиями

(Новая страница: «The rule works like this: * when movement appears, the light turns on. If a thirty-second "off" timer was previously started, this timer is disabled; * when motion is lost, a thirty second "off" timer is started. If he manages to reach the end, the light turns off.»)
(Новая страница: «<syntaxhighlight lang="ecmascript"> var motion_timer_1_timeout_ms = 30 * 1000; var motion_timer_1_id = null;»)
Строка 78: Строка 78:
</syntaxhighlight>
</syntaxhighlight>


<div lang="ru" dir="ltr" class="mw-content-ltr">
=== Creating similar rules ===
=== Создание однотипных правил ===
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
If you need several such motion detectors, then in order not to copy the code, you can wrap the creation of the rule and variables in a function:
Если таких детекторов движения нужно несколько, то, чтобы не копировать код, можно обернуть создание правила и переменных в функцию:
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<div lang="ru" dir="ltr" class="mw-content-ltr">