Example #1
0
 public InsteonDevice(InsteonId address, InsteonController controller, string name = null, string zone = null, string alias = null)
 {
     Address    = address;
     Controller = controller ?? this as InsteonController;
     Zone       = zone ?? "";
     Name       = name ?? address.ToString();
     Alias      = alias ?? Name;
 }
Example #2
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);
 }
Example #3
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;
 }