2485
правок
Fizikdaos (обсуждение | вклад) (Новая страница: «{{DISPLAYTITLE: Примеры правил}} === Слежение за контролом === <!--T:20--> <!--T:21--> Это простейшее правило…») |
Admin (обсуждение | вклад) |
||
Строка 80: | Строка 80: | ||
<syntaxhighlight lang="ecmascript"> | <syntaxhighlight lang="ecmascript"> | ||
var motion_timer_1_timeout_ms = 30 * 1000; | var motion_timer_1_timeout_ms = 30 * 1000; | ||
var motion_timer_1_id = null; | var motion_timer_1_id = null; | ||
defineRule("motion_detector_1", { | defineRule("motion_detector_1", { | ||
whenChanged: "wb-gpio/D2_IN", | whenChanged: "wb-gpio/D2_IN", | ||
Строка 91: | Строка 89: | ||
dev["wb-gpio"]["Relay_1"] = 1; | dev["wb-gpio"]["Relay_1"] = 1; | ||
if (motion_timer_1_id) { | if (motion_timer_1_id) { | ||
clearTimeout(motion_timer_1_id); | clearTimeout(motion_timer_1_id); | ||
Строка 103: | Строка 100: | ||
} | } | ||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Создание однотипных правил === <!--T:43--> | === Создание однотипных правил === <!--T:43--> |