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); }
public WeMoSwitch(string ip, int port) { _client = new BasicServicePortTypeClient(); _client.Endpoint.Address = new EndpointAddress($"http://{ip}:{port}/upnp/control/basicevent1"); }
public WeMoDevice(WeMoNetwork network, BasicServicePortTypeClient client, string address) : base(network, DeviceType.BinarySwitch) { Address = address; _binarySwitch = new WeMoBinarySwitch(client); }
public WeMoBinarySwitch(BasicServicePortTypeClient client) { _client = client; }