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

Новая страница: «} }); </syntaxhighlight>»
(Новая страница: «The same, but with a virtual device as an event source. Usage example: scripted button that turns on/off the siren and light bulb.»)
(Новая страница: «} }); </syntaxhighlight>»)
Строка 26: Строка 26:
The same, but with a virtual device as an event source. Usage example: scripted button that turns on/off the siren and light bulb.
The same, but with a virtual device as an event source. Usage example: scripted button that turns on/off the siren and light bulb.


<div lang="ru" dir="ltr" class="mw-content-ltr">
<syntaxhighlight lang="ecmascript">
<syntaxhighlight lang="ecmascript">
defineVirtualDevice("simple_test", {
defineVirtualDevice("simple_test", {
Строка 37: Строка 36:
     }
     }
});
});
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
defineRule("simple_switch", {
defineRule("simple_switch", {
   whenChanged: "simple_test/enabled",
   whenChanged: "simple_test/enabled",
Строка 45: Строка 42:
dev["wb-gpio"]["Relay_2"] = newValue;
dev["wb-gpio"]["Relay_2"] = newValue;
dev["wb-mrm2_6"]["Relay 1"] = newValue;
dev["wb-mrm2_6"]["Relay 1"] = newValue;
</div>


   <div lang="ru" dir="ltr" class="mw-content-ltr">
   }
}
});
});
</syntaxhighlight>
</syntaxhighlight>
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<div lang="ru" dir="ltr" class="mw-content-ltr">
translator, wb_editors
4293

правки