Example #1
0
        public void Connect(string host)
        {
            var binding = new System.ServiceModel.BasicHttpBinding();
            var address = new System.ServiceModel.EndpointAddress("http://" + host + ":49153/upnp/control/basicevent1");
            var client = new BasicServicePortTypeClient(binding, address);
            var device = new WeMoDevice(this, client, (_devices.Count + 1).ToString());

            _devices.Add(device);
        }
Example #2
0
        public void Connect(string host)
        {
            var binding = new System.ServiceModel.BasicHttpBinding();
            var address = new System.ServiceModel.EndpointAddress("http://" + host + ":49153/upnp/control/basicevent1");
            var client  = new BasicServicePortTypeClient(binding, address);
            var device  = new WeMoDevice(this, client, (_devices.Count + 1).ToString());

            _devices.Add(device);
        }
Example #3
0
 public WeMoSwitch(string ip, int port)
 {
     _client = new BasicServicePortTypeClient();
     _client.Endpoint.Address = new EndpointAddress($"http://{ip}:{port}/upnp/control/basicevent1");
 }
Example #4
0
 public WeMoDevice(WeMoNetwork network, BasicServicePortTypeClient client, string address)
     : base(network, DeviceType.BinarySwitch)
 {
     Address       = address;
     _binarySwitch = new WeMoBinarySwitch(client);
 }
Example #5
0
 public WeMoBinarySwitch(BasicServicePortTypeClient client)
 {
     _client = client;
 }
Example #6
0
 public WeMoDevice(WeMoNetwork network, BasicServicePortTypeClient client, string address)
     : base(network, DeviceType.BinarySwitch)
 {
     Address = address;
     _binarySwitch = new WeMoBinarySwitch(client);
 }
Example #7
0
 public WeMoSwitch(string ip, int port)
 {
     _client = new BasicServicePortTypeClient();
     _client.Endpoint.Address = new EndpointAddress($"http://{ip}:{port}/upnp/control/basicevent1");
 }
Example #8
0
 public WeMoBinarySwitch(BasicServicePortTypeClient client)
 {
     _client = client;
 }