Материал из Module developer
SubDevice.AddAction (works via a function)
Add an action (used in macros and rules). Parameters in brackets are not obligatory
Синтаксис
SubDevice.AddAction(Name, ScriptCall, Method, Space, [Default], [SmartID], [AdvancedField], [Hidden])
| Название | Пример | Описание |
| Name | "Power on" | type: String Action name |
| ScriptCall | true | type: Boolean feature that an action works via a function. Use true |
| Method | function(in_data){...} | type: Function Fucntion that is being executed. The incoming parameter to the function can be:
|
| Space | this | type: Object Pointer to an object that services a function. If a pointer is not required an empty object or undefined can be put |
| Default | "1" | type: String Value that is an arriving parameter to Method |
| SmartID | type: Number The parameter is not available yet, that's why set null |
| AdvancedField | {Name, Type, ...} | type: Object, Array It is used to work with complicated actions. When AdvancedField is used, put null in Default parameter. One object or an object can be sent in AdvancedField. |
| На выходе |
{{{output}}}
Пример
{{{JSsample}}}
{{{attentions}}}
