示例#1
0
 public static InsteonDevice CreateDevice(XElement el, InsteonController c)
 {
     switch (el.Name.ToString())
     {
     case nameof(SwitchLinc):
     case "Light":
         return(new SwitchLinc(
                    c,
                    el.Attribute("Id")?.Value,
                    el.Attribute("Name")?.Value,
                    el.Ancestors("Zone")?.FirstOrDefault()?.Attribute("Name")?.Value,
                    el.Attribute("Alias")?.Value,
                    LightLevelCurve.GetByNameOrDefault(el.Attribute("Type")?.Value)));
     }
     return(null);
 }
示例#2
0
 public SwitchLinc(InsteonController controller, InsteonId address, string name = null, string zone = null, string alias = null, LightLevelCurve levelCurve = null)
     : base(address, controller, name, zone, alias)
 {
     LevelCurve = levelCurve;
 }