public static IList <Device> GetDevices() { var list = new List <Device>(); var waveInDevices = WaveIn.DeviceCount; for (int deviceIndex = 0; deviceIndex < waveInDevices; deviceIndex++) { list.Add(DeviceMapper.Map(deviceIndex, WaveIn.GetCapabilities(deviceIndex))); } return(list); }
public async Task <StationDevices> Get() { string url = string.Format("{0}?access_token={1}&app_type=app_station", _uri, _authenticationToken.Token); var deviceListResponce = await _httpWrapper.ReadGet <DeviceListResponse>(url); //var client = new HttpClient(); //HttpResponseMessage response = client.GetAsync(url).Result; //if (!response.IsSuccessStatusCode) //{ // Trace.WriteLine("DevicesList Failed!"); // throw new NetatmoReadException("Failed to read devices. Status code: " + response.StatusCode); //} //var deviceListResponce = response.Content.ReadAsAsync<DeviceListResponse>().Result; return(DeviceMapper.Map(deviceListResponce.body)); }