Материал из Module developer
Перейти к: навигация, поиск

SubDevice.AddEvent (works via a function)

Add an event. An event is an obligatory part of creating rules. This event works via a function

Синтаксис

SubDevice.AddEvent(Name, Path, ScriptCall, Method, Space, [Default], [AdvancedField])

Название Пример Описание
Name "Temperature drops below..." type: String
Event name
Path "Drivers.Nest.CurrentTemperature" type: String
Full path to a channel, a driver feedback channel or a token. Subsciption to keeping track of changes
ScriptCall true type: Boolean
Feature od working via a funtion. In this realization set true
Method function(in_data){...} type: Function
Performed function. The coming parameter to the function can be:
  • If [Default] is used, the coming parameter is Default value in the String format, set by a module developer
  • If [AdvancedField] is used, the coming parameter is a value of Object or String type depending on the [AdvancedField] format.
На выходе

{{{output}}}


Пример

{{{JSsample}}}

{{{attentions}}}