public void RemovePin(BlynkPin pin) { if (this.pins != null && this.pins.Contains(pin)) { this.pins.Remove(pin); } }
public void AddPin(BlynkPin pin) { if (this.pins != null && !this.pins.Contains(pin)) { pin.Client = this; this.pins.Add(pin); } }
public bool WritePin(BlynkPin pin) { string pinType = pin.PinType == PinType.Digital ? "D" : "V"; this.blynkClient = new RestClient(string.Format("{0}/{1}/update/{2}{3}?value={4}", this.BlynkUri, this.AuthToken, pinType, pin.Pin, pin.Value)); RestResponse response = this.blynkClient.Get(); if (response.StatusCode != HttpStatusCode.OK) { OnBadResponseEvent(new BadResponseEventArgs { StatusCode = (int)response.StatusCode, Message = response.Content }); return(false); } return(true); }
public VirtualPinDataReceivedEventArgs(BlynkPin pin) : this() { this.BlynkPin = pin; }