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

//Creating a condition with Default var l_oCondition = l_oSubDevice.AddCondition("Temperature is below...", "Drivers.Nest.CurrentTemperature", true, function(in_data){

var l_nValue = parseInt(in_data, 10); //getting in_data в in a numeric form var l_nFeedback = parseInt(l_oSubDevice.GetFeedback("CurrentTemperature"), 10); //getting feedback in a numeric form // making a comparison if (l_nFeedback < l_nValue) return true;

}, this, "23");