translator, wb_editors
4544
правки
Matveevrj (обсуждение | вклад) (Новая страница: «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.») |
Matveevrj (обсуждение | вклад) (Новая страница: «<syntaxhighlight lang="ecmascript"> var motion_timer_1_timeout_ms = 30 * 1000; var motion_timer_1_id = null;») |
||
Строка 78: | Строка 78: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Creating similar rules === | |||
=== | |||
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 lang="ru" dir="ltr" class="mw-content-ltr"> | <div lang="ru" dir="ltr" class="mw-content-ltr"> |