Example #1
0
 protected SwitchConnectionBase(string ipaddress, int port, SwitchBotConfig cfg)
 {
     IP            = ipaddress;
     Port          = port;
     UsbPortIndex  = cfg.UsbPortIndex;
     ConnectionUSB = new SwitchConnectionUSB(cfg);
     Config        = cfg;
     Name          = $"{IP}{(cfg.ConnectionType == ConnectionType.USB ? " [#"+UsbPortIndex+"]" : string.Empty)}: {GetType().Name}";
     Log("Connection details created!");
 }
 public SwitchConnection(SwitchBotConfig cfg) : this(cfg.IP, cfg.Port)
 {
 }
 public SwitchConnectionUSB(SwitchBotConfig cfg)
 {
     Config = cfg;
 }
 public SwitchConnectionAsync(SwitchBotConfig cfg) : this(cfg.IP, cfg.Port, cfg)
 {
 }
 public SwitchConnectionAsync(string ipaddress, int port, SwitchBotConfig cfg) : base(ipaddress, port, cfg)
 {
 }
Example #6
0
 public SwitchConnection(string ip, int port, SwitchBotConfig cfg) : base(ip, port, cfg)
 {
 }