Материал из Module developer
Перейти к: навигация, поиск
     // Assigning graphic items to feedback channels                
     dimmer.GetItem("Name").Text = md.data;            
     IR.AddRelation("Drivers." + netWorkName + "." + deviceName + ":" + "channel" + md.W + moduleID, "UI.Dimmer" + md.index + moduleID + ".Visible Level.Value");
     IR.AddRelation("Drivers." + netWorkName + "." + deviceName + ":" + "channel" + md.W + moduleID, "UI.Dimmer" + md.index + moduleID + ".Level.Value");
     IR.AddRelation("Drivers." + netWorkName + "." + deviceName + ":" + "channel" + md.W + moduleID, "UI.Dimmer" + md.index + moduleID + ".label main title 640x88.Value"); 
     IR.AddRelation("Drivers." + netWorkName + "." + deviceName + ":" + "channel" + md.W + moduleID, "UI.Dimmer" + md.index + moduleID + ".Button.Value");
     
     // Add the action for the lamp 
     md.subDevice.addAction ({
        ActionType: "Simple",  // Indicate the action type 
        Type: "script_call",   // Indicate the type of action 
        Param: {lamp: 1, set: 100},   // Send the parameters, it is not required for calling the function 
        Space: this,  // Send the space for calling the function, it is not required 
        Method: changeLight, // Send the method 
        Name: "Turn On"    // Indicate the method name 
     });
  };