Пример #1
0
 public void RemovePin(BlynkPin pin)
 {
     if (this.pins != null && this.pins.Contains(pin))
     {
         this.pins.Remove(pin);
     }
 }
Пример #2
0
 public void AddPin(BlynkPin pin)
 {
     if (this.pins != null && !this.pins.Contains(pin))
     {
         pin.Client = this;
         this.pins.Add(pin);
     }
 }
Пример #3
0
        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);
        }
Пример #4
0
 public VirtualPinDataReceivedEventArgs(BlynkPin pin)
     : this()
 {
     this.BlynkPin = pin;
 }