public GetStates DigitalWrite(Pins pin, SetStates state) { Response result = Post(Functions.digitalwrite, String.Format(payloadWrite, HttpUtility.UrlEncode(AccessToken), HttpUtility.UrlEncode(pin.ToString()), HttpUtility.UrlEncode(state.ToString()))); switch (result.ReturnValue) { case -1: return(GetStates.FAIL); default: if (state == SetStates.HIGH) { return(GetStates.HIGH); } return(GetStates.LOW); } }
public GetStates DigitalWrite(Pins pin, SetStates state) { Response result = Post(Functions.digitalwrite, String.Format(payloadWrite, HttpUtility.UrlEncode(AccessToken), HttpUtility.UrlEncode(pin.ToString()), HttpUtility.UrlEncode(state.ToString()))); switch (result.ReturnValue) { case -1: return GetStates.FAIL; default: if (state == SetStates.HIGH) return GetStates.HIGH; return GetStates.LOW; } }
public async Task SetStates(Mix mix) { SetStates api = new SetStates(this.Identity); await api.Set(mix); }