internal WeatherResult ToWeatherResult(LocationResult location) { ITemperature temperature = new DegreesFahrenheit(this.Temperature.Value); WindSpeed windSpeed = new WindSpeed(new MilesPerHour(this.Wind.Speed.Imperial.Value), this.Wind.Direction.Degrees); LatitudeLongitude latLong = new LatitudeLongitude(location.GeoPosition.Latitude, location.GeoPosition.Longitude); return(new WeatherResult(temperature, latLong, windSpeed)); }
private async Task <List <TemperatureResult> > GetTemperatureAsync(LocationResult location) { string url = $"http://dataservice.accuweather.com/forecasts/v1/hourly/1hour/{location.Key}?apikey={ApiKey}"; string json = await GetJsonAsync(url); var result = Newtonsoft.Json.JsonConvert.DeserializeObject <List <TemperatureResult> >(json); return(result); }
internal WeatherResult ToWeatherResult(LocationResult location, WindSpeed windSpeed) { return(new WeatherResult(new DegreesFahrenheit(this.Temperature.Value), new LatitudeLongitude(location.GeoPosition.Latitude, location.GeoPosition.Longitude), windSpeed)); }
private async Task <List <CurrentConditionsResult> > GetCurrentConditionsAsync(LocationResult location) { string url = $"http://dataservice.accuweather.com/currentconditions/v1/{location.Key}?apikey={ApiKey}"; var json = await GetJsonAsync(url); return(Newtonsoft.Json.JsonConvert.DeserializeObject <List <CurrentConditionsResult> >(json)); }