translator, wb_editors
4544
правки
Matveevrj (обсуждение | вклад) (Новая страница: «=== Examples === {{YouTube |link=https://youtu.be/C60KB7TCeKg |text= Rule example }} In the example, we are using the WB-MCM8 to control the first dimmer channel WB-MDM3: # Short press turns on the channel. # Double - turns off the channel. # Long - increases brightness. # Short, then long - reduces brightness.») |
Matveevrj (обсуждение | вклад) (Новая страница: «Since changing the brightness requires a time-consuming action, we use a timer. We also control the state of the input with the button and stop the action when the button is released.») |
||
Строка 322: | Строка 322: | ||
# Short, then long - reduces brightness. | # Short, then long - reduces brightness. | ||
Since changing the brightness requires a time-consuming action, we use a timer. We also control the state of the input with the button and stop the action when the button is released. | |||
<syntaxhighlight lang="js"> | <syntaxhighlight lang="js"> | ||
/* ---------------------------- */ | /* ---------------------------- */ | ||
/* 1. Single Press Counter: On action*/ | /* 1. Single Press Counter: On action*/ | ||
/* ---------------------------- */ | /* ---------------------------- */ | ||
defineRule({ | defineRule({ | ||
whenChanged: "wb-mcm8_20/Input 1 Single Press Counter", | whenChanged: "wb-mcm8_20/Input 1 Single Press Counter", | ||
Строка 340: | Строка 335: | ||
} | } | ||
}); | }); | ||
/* ---------------------------- */ | /* ---------------------------- */ | ||
/* 2. Double Press Counter: Off action*/ | /* 2. Double Press Counter: Off action*/ | ||
/* ---------------------------- */ | /* ---------------------------- */ | ||
defineRule({ | defineRule({ | ||
whenChanged: "wb-mcm8_20/Input 1 Double Press Counter", | whenChanged: "wb-mcm8_20/Input 1 Double Press Counter", | ||
Строка 356: | Строка 347: | ||
} | } | ||
}); | }); | ||