Перейти к содержанию

Навигация

Движок правил wb-rules/en: различия между версиями

Новая страница: «There are two types of rules :the rules themselves (start with defineRule) and virtual devices (start with defineVirtualDevice). Virtual devices are new switchers…»
(Новая страница: «There are two types of rules :the rules themselves (start with defineRule) and virtual devices (start with defineVirtualDevice). Virtual devices are new switchers…»)
Строка 23: Строка 23:
[[File:Web-scripts-rule1.png|400px|thumb|The rule for the heater control, written via the web interface]]
[[File:Web-scripts-rule1.png|400px|thumb|The rule for the heater control, written via the web interface]]


Правила бывают двух типов - непосредственно правила (начинаются со слов ''defineRule'') и виртуальные устройства (начинаются со слов ''defineVirtualDevice''). Виртуальные устройства - это появляющиеся в веб-интерфейсе новые элементы управления - например, кнопка-выключатель, которая на самом деле выключает два устройства одновременно. Она не привязана напрямую ни к какому физическому устройству, а действия при её нажатии определяются написанным вами скриптом.
There are two types of rules :the rules themselves (start with defineRule) and virtual devices (start with defineVirtualDevice). Virtual devices are new switchers that appear in the web interface - for example, a toggle button that actually turns off two devices at the same time. It is not tied directly to any physical device, and the actions when you click it are determined by the script you wrote.


Любое количество разных правил можно хранить в одном файле. Обычно в одном файле хранятся правила, отвечающие за близкие функции.
Любое количество разных правил можно хранить в одном файле. Обычно в одном файле хранятся правила, отвечающие за близкие функции.
12 063

правки