diff --git a/CHANGELOG.md b/CHANGELOG.md index efabb61..d5ff429 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### 0.4.1 (Next) +* [#25](https://github.com/dblock/open-weather-ruby-client/pull/25): Exposed the national weather alerts response in the One Call API - [@troya2](https://github.com/troya2). * Your contribution here. ### 0.4.0 (2023/08/13) diff --git a/README.md b/README.md index 77dd57b..d098bae 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ data.main.temp # => 285.15 ### One Call -[One Call API](https://openweathermap.org/api/one-call-api) provides current weather, minute forecast for 1 hour, hourly forecast for 48 hours, daily forecast for 7 days, and historical weather data for 5 previous days for any geographical coordinate. +[One Call API](https://openweathermap.org/api/one-call-api) provides current weather, minute forecast for 1 hour, hourly forecast for 48 hours, daily forecast for 7 days, historical weather data for 5 previous days for any geographical coordinate, and national weather alerts. See [OpenWeather::Models::OneCall](lib/open_weather/models/one_call) for all available models and properties. @@ -182,6 +182,7 @@ data.current # => OpenWeather::Models::OneCall::CurrentWeather data.minutely # => Array[OpenWeather::Models::OneCall::MinutelyWeather] data.hourly # => Array[OpenWeather::Models::OneCall::HourlyWeather] data.daily # => Array[OpenWeather::Models::OneCall::DailyWeather] +data.alerts # => Array[OpenWeather::Models::OneCall::Alert] ``` Exclude minutely and hourly data. diff --git a/lib/open_weather/models/one_call.rb b/lib/open_weather/models/one_call.rb index e4dc09c..ebe8da1 100644 --- a/lib/open_weather/models/one_call.rb +++ b/lib/open_weather/models/one_call.rb @@ -7,3 +7,4 @@ require_relative 'one_call/hourly_weather' require_relative 'one_call/minutely_weather' require_relative 'one_call/weather' +require_relative 'one_call/alert' diff --git a/lib/open_weather/models/one_call/alert.rb b/lib/open_weather/models/one_call/alert.rb new file mode 100644 index 0000000..a1de2cd --- /dev/null +++ b/lib/open_weather/models/one_call/alert.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module OpenWeather + module Models + module OneCall + class Alert < Model + property 'sender_name' + property 'event' + property 'start', transform_with: ->(v) { Time.at(v).utc } # UTC + property 'end', transform_with: ->(v) { Time.at(v).utc } # UTC + property 'description' + end + end + end +end diff --git a/lib/open_weather/models/one_call/weather.rb b/lib/open_weather/models/one_call/weather.rb index 9d4fb45..a059738 100644 --- a/lib/open_weather/models/one_call/weather.rb +++ b/lib/open_weather/models/one_call/weather.rb @@ -11,6 +11,7 @@ class Weather < Model property 'minutely' # minute forecast weather property 'hourly' # hourly forecast weather property 'daily' # daily forecast weather + property 'alerts' # weather alerts for the location def initialize(args = nil, options = {}) super args, options @@ -19,6 +20,7 @@ def initialize(args = nil, options = {}) self.minutely = minutely.map { |i| OpenWeather::Models::OneCall::MinutelyWeather.new(i, options) } if minutely self.hourly = hourly.map { |i| OpenWeather::Models::OneCall::HourlyWeather.new(i, options) } if hourly self.daily = daily.map { |i| OpenWeather::Models::OneCall::DailyWeather.new(i, options) } if daily + self.alerts = alerts.map { |i| OpenWeather::Models::OneCall::Alert.new(i, options) } if alerts end end end diff --git a/spec/fixtures/open_weather/one_call/lat_lon.yml b/spec/fixtures/open_weather/one_call/lat_lon.yml index 1a2a92b..c4c10be 100644 --- a/spec/fixtures/open_weather/one_call/lat_lon.yml +++ b/spec/fixtures/open_weather/one_call/lat_lon.yml @@ -2,15 +2,17 @@ http_interactions: - request: method: get - uri: https://api.openweathermap.org/data/2.5/onecall?appid=api-key&lat=33.441792&lon=-94.037689 + uri: https://api.openweathermap.org/data/2.5/onecall?appid=api-key&lat=33.5312&lon=-111.9426 body: encoding: US-ASCII string: '' headers: Accept: - application/json; charset=utf-8 + Content-Type: + - application/json User-Agent: - - OpenWeather Ruby Client/0.2.0 + - OpenWeather Ruby Client/0.2.1 Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 response: @@ -21,15 +23,15 @@ http_interactions: Server: - openresty Date: - - Thu, 14 May 2020 03:09:08 GMT + - Sun, 31 Dec 2023 23:20:20 GMT Content-Type: - application/json; charset=utf-8 Content-Length: - - '16841' + - '21294' Connection: - keep-alive X-Cache-Key: - - "/data/2.5/onecall?lat=33.44&lon=-94.04" + - "/data/2.5/onecall?lat=33.53&lon=-111.94" Access-Control-Allow-Origin: - "*" Access-Control-Allow-Credentials: @@ -38,64 +40,80 @@ http_interactions: - GET, POST body: encoding: UTF-8 - string: '{"lat":33.44,"lon":-94.04,"timezone":"America/Chicago","current":{"dt":1589425748,"sunrise":1589368621,"sunset":1589418488,"temp":295.55,"feels_like":296.21,"pressure":1015,"humidity":64,"dew_point":288.41,"uvi":10.31,"clouds":1,"visibility":16093,"wind_speed":1.5,"wind_deg":130,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},"minutely":[{"dt":1589425800,"precipitation":0},{"dt":1589425860,"precipitation":0},{"dt":1589425920,"precipitation":0},{"dt":1589425980,"precipitation":0},{"dt":1589426040,"precipitation":0},{"dt":1589426100,"precipitation":0},{"dt":1589426160,"precipitation":0},{"dt":1589426220,"precipitation":0},{"dt":1589426280,"precipitation":0},{"dt":1589426340,"precipitation":0},{"dt":1589426400,"precipitation":0},{"dt":1589426460,"precipitation":0},{"dt":1589426520,"precipitation":0},{"dt":1589426580,"precipitation":0},{"dt":1589426640,"precipitation":0},{"dt":1589426700,"precipitation":0},{"dt":1589426760,"precipitation":0},{"dt":1589426820,"precipitation":0},{"dt":1589426880,"precipitation":0},{"dt":1589426940,"precipitation":0},{"dt":1589427000,"precipitation":0},{"dt":1589427060,"precipitation":0},{"dt":1589427120,"precipitation":0},{"dt":1589427180,"precipitation":0},{"dt":1589427240,"precipitation":0},{"dt":1589427300,"precipitation":0},{"dt":1589427360,"precipitation":0},{"dt":1589427420,"precipitation":0},{"dt":1589427480,"precipitation":0},{"dt":1589427540,"precipitation":0},{"dt":1589427600,"precipitation":0},{"dt":1589427660,"precipitation":0},{"dt":1589427720,"precipitation":0},{"dt":1589427780,"precipitation":0},{"dt":1589427840,"precipitation":0},{"dt":1589427900,"precipitation":0},{"dt":1589427960,"precipitation":0},{"dt":1589428020,"precipitation":0},{"dt":1589428080,"precipitation":0},{"dt":1589428140,"precipitation":0},{"dt":1589428200,"precipitation":0},{"dt":1589428260,"precipitation":0},{"dt":1589428320,"precipitation":0},{"dt":1589428380,"precipitation":0},{"dt":1589428440,"precipitation":0},{"dt":1589428500,"precipitation":0},{"dt":1589428560,"precipitation":0},{"dt":1589428620,"precipitation":0},{"dt":1589428680,"precipitation":0},{"dt":1589428740,"precipitation":0},{"dt":1589428800,"precipitation":0},{"dt":1589428860,"precipitation":0},{"dt":1589428920,"precipitation":0},{"dt":1589428980,"precipitation":0},{"dt":1589429040,"precipitation":0},{"dt":1589429100,"precipitation":0},{"dt":1589429160,"precipitation":0},{"dt":1589429220,"precipitation":0},{"dt":1589429280,"precipitation":0},{"dt":1589429340,"precipitation":0},{"dt":1589429400,"precipitation":0}],"hourly":[{"dt":1589425200,"temp":295.55,"feels_like":293.69,"pressure":1015,"humidity":64,"dew_point":288.41,"clouds":1,"wind_speed":5.1,"wind_deg":134,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},{"dt":1589428800,"temp":294.13,"feels_like":293.31,"pressure":1015,"humidity":78,"dew_point":290.15,"clouds":5,"wind_speed":4.56,"wind_deg":144,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},{"dt":1589432400,"temp":292.91,"feels_like":292.73,"pressure":1015,"humidity":87,"dew_point":290.69,"clouds":6,"wind_speed":3.97,"wind_deg":155,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},{"dt":1589436000,"temp":291.94,"feels_like":292.1,"pressure":1016,"humidity":94,"dew_point":290.95,"clouds":7,"wind_speed":3.64,"wind_deg":162,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},{"dt":1589439600,"temp":291.61,"feels_like":291.6,"pressure":1016,"humidity":95,"dew_point":290.79,"clouds":0,"wind_speed":3.79,"wind_deg":173,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},{"dt":1589443200,"temp":291.62,"feels_like":291.45,"pressure":1015,"humidity":94,"dew_point":290.76,"clouds":2,"wind_speed":3.93,"wind_deg":169,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},{"dt":1589446800,"temp":291.41,"feels_like":291.8,"pressure":1015,"humidity":95,"dew_point":290.7,"clouds":34,"wind_speed":3.1,"wind_deg":182,"weather":[{"id":802,"main":"Clouds","description":"scattered - clouds","icon":"03n"}]},{"dt":1589450400,"temp":291,"feels_like":291.67,"pressure":1015,"humidity":97,"dew_point":290.54,"clouds":51,"wind_speed":2.65,"wind_deg":165,"weather":[{"id":803,"main":"Clouds","description":"broken - clouds","icon":"04n"}]},{"dt":1589454000,"temp":290.8,"feels_like":290.97,"pressure":1015,"humidity":97,"dew_point":290.46,"clouds":52,"wind_speed":3.25,"wind_deg":156,"weather":[{"id":803,"main":"Clouds","description":"broken - clouds","icon":"04n"}]},{"dt":1589457600,"temp":291.14,"feels_like":291.35,"pressure":1015,"humidity":97,"dew_point":290.82,"clouds":60,"wind_speed":3.39,"wind_deg":156,"weather":[{"id":803,"main":"Clouds","description":"broken - clouds","icon":"04d"}]},{"dt":1589461200,"temp":292.99,"feels_like":292.89,"pressure":1016,"humidity":93,"dew_point":291.87,"clouds":100,"wind_speed":4.55,"wind_deg":159,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589464800,"temp":294.7,"feels_like":294.49,"pressure":1016,"humidity":88,"dew_point":292.8,"clouds":100,"wind_speed":5.23,"wind_deg":161,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589468400,"temp":295.66,"feels_like":295.92,"pressure":1016,"humidity":86,"dew_point":293.23,"clouds":100,"wind_speed":4.94,"wind_deg":169,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589472000,"temp":296.04,"feels_like":296.44,"pressure":1016,"humidity":84,"dew_point":293.38,"clouds":100,"wind_speed":4.74,"wind_deg":169,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589475600,"temp":296.63,"feels_like":296.71,"pressure":1016,"humidity":83,"dew_point":293.62,"clouds":100,"wind_speed":5.46,"wind_deg":165,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589479200,"temp":297.63,"feels_like":297.87,"pressure":1015,"humidity":79,"dew_point":293.94,"clouds":100,"wind_speed":5.34,"wind_deg":169,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589482800,"temp":298.45,"feels_like":299.14,"pressure":1015,"humidity":79,"dew_point":294.65,"clouds":72,"wind_speed":5.27,"wind_deg":172,"weather":[{"id":500,"main":"Rain","description":"light - rain","icon":"10d"}],"rain":{"1h":0.35}},{"dt":1589486400,"temp":298.99,"feels_like":299.98,"pressure":1014,"humidity":78,"dew_point":295,"clouds":62,"wind_speed":5.08,"wind_deg":172,"weather":[{"id":500,"main":"Rain","description":"light - rain","icon":"10d"}],"rain":{"1h":0.67}},{"dt":1589490000,"temp":299.9,"feels_like":301.24,"pressure":1013,"humidity":73,"dew_point":294.85,"clouds":44,"wind_speed":4.42,"wind_deg":168,"weather":[{"id":500,"main":"Rain","description":"light - rain","icon":"10d"}],"rain":{"1h":0.2}},{"dt":1589493600,"temp":299.82,"feels_like":301.25,"pressure":1012,"humidity":74,"dew_point":295.01,"clouds":41,"wind_speed":4.4,"wind_deg":171,"weather":[{"id":500,"main":"Rain","description":"light - rain","icon":"10d"}],"rain":{"1h":0.16}},{"dt":1589497200,"temp":299.25,"feels_like":300.7,"pressure":1012,"humidity":77,"dew_point":294.98,"clouds":35,"wind_speed":4.45,"wind_deg":163,"weather":[{"id":802,"main":"Clouds","description":"scattered - clouds","icon":"03d"}]},{"dt":1589500800,"temp":298.17,"feels_like":300.39,"pressure":1012,"humidity":83,"dew_point":295.13,"clouds":29,"wind_speed":3.49,"wind_deg":153,"weather":[{"id":802,"main":"Clouds","description":"scattered - clouds","icon":"03d"}]},{"dt":1589504400,"temp":296.07,"feels_like":298.12,"pressure":1012,"humidity":90,"dew_point":294.44,"clouds":0,"wind_speed":3.18,"wind_deg":137,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01d"}]},{"dt":1589508000,"temp":294.83,"feels_like":296.14,"pressure":1012,"humidity":93,"dew_point":293.78,"clouds":0,"wind_speed":3.75,"wind_deg":135,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},{"dt":1589511600,"temp":294.39,"feels_like":295.42,"pressure":1013,"humidity":94,"dew_point":293.42,"clouds":0,"wind_speed":3.97,"wind_deg":145,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},{"dt":1589515200,"temp":294.05,"feels_like":294.96,"pressure":1013,"humidity":93,"dew_point":293.02,"clouds":0,"wind_speed":3.8,"wind_deg":150,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},{"dt":1589518800,"temp":293.75,"feels_like":294.6,"pressure":1013,"humidity":94,"dew_point":292.83,"clouds":8,"wind_speed":3.8,"wind_deg":158,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}]},{"dt":1589522400,"temp":293.76,"feels_like":294.38,"pressure":1013,"humidity":93,"dew_point":292.76,"clouds":23,"wind_speed":4.02,"wind_deg":162,"weather":[{"id":801,"main":"Clouds","description":"few - clouds","icon":"02n"}]},{"dt":1589526000,"temp":293.68,"feels_like":294.52,"pressure":1013,"humidity":94,"dew_point":292.73,"clouds":98,"wind_speed":3.76,"wind_deg":174,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04n"}]},{"dt":1589529600,"temp":293.44,"feels_like":294.16,"pressure":1013,"humidity":95,"dew_point":292.69,"clouds":84,"wind_speed":3.89,"wind_deg":172,"weather":[{"id":803,"main":"Clouds","description":"broken - clouds","icon":"04n"}]},{"dt":1589533200,"temp":293.09,"feels_like":293.98,"pressure":1012,"humidity":96,"dew_point":292.54,"clouds":80,"wind_speed":3.53,"wind_deg":172,"weather":[{"id":803,"main":"Clouds","description":"broken - clouds","icon":"04n"}]},{"dt":1589536800,"temp":292.76,"feels_like":293.74,"pressure":1012,"humidity":97,"dew_point":292.41,"clouds":80,"wind_speed":3.3,"wind_deg":170,"weather":[{"id":803,"main":"Clouds","description":"broken - clouds","icon":"04n"}]},{"dt":1589540400,"temp":292.61,"feels_like":293.63,"pressure":1012,"humidity":98,"dew_point":292.31,"clouds":77,"wind_speed":3.25,"wind_deg":174,"weather":[{"id":803,"main":"Clouds","description":"broken - clouds","icon":"04n"}]},{"dt":1589544000,"temp":293.02,"feels_like":293.88,"pressure":1013,"humidity":97,"dew_point":292.69,"clouds":73,"wind_speed":3.64,"wind_deg":166,"weather":[{"id":803,"main":"Clouds","description":"broken - clouds","icon":"04d"}]},{"dt":1589547600,"temp":294.49,"feels_like":295.16,"pressure":1013,"humidity":93,"dew_point":293.42,"clouds":84,"wind_speed":4.43,"wind_deg":174,"weather":[{"id":803,"main":"Clouds","description":"broken - clouds","icon":"04d"}]},{"dt":1589551200,"temp":295.09,"feels_like":296.1,"pressure":1014,"humidity":91,"dew_point":293.63,"clouds":92,"wind_speed":4.12,"wind_deg":180,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589554800,"temp":295.59,"feels_like":296.69,"pressure":1014,"humidity":89,"dew_point":293.82,"clouds":94,"wind_speed":4.07,"wind_deg":175,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589558400,"temp":296.25,"feels_like":297.57,"pressure":1015,"humidity":88,"dew_point":294.18,"clouds":96,"wind_speed":4.09,"wind_deg":173,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589562000,"temp":296.9,"feels_like":298.63,"pressure":1015,"humidity":86,"dew_point":294.47,"clouds":97,"wind_speed":3.7,"wind_deg":172,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589565600,"temp":297.07,"feels_like":298.99,"pressure":1014,"humidity":86,"dew_point":294.65,"clouds":98,"wind_speed":3.55,"wind_deg":169,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589569200,"temp":297.55,"feels_like":299.62,"pressure":1013,"humidity":84,"dew_point":294.81,"clouds":100,"wind_speed":3.39,"wind_deg":168,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589572800,"temp":299.4,"feels_like":301.94,"pressure":1012,"humidity":76,"dew_point":294.87,"clouds":100,"wind_speed":2.84,"wind_deg":171,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589576400,"temp":300.79,"feels_like":303.46,"pressure":1012,"humidity":70,"dew_point":294.91,"clouds":99,"wind_speed":2.64,"wind_deg":170,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589580000,"temp":300.91,"feels_like":303.83,"pressure":1011,"humidity":71,"dew_point":295.19,"clouds":99,"wind_speed":2.55,"wind_deg":152,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589583600,"temp":301.01,"feels_like":303.85,"pressure":1011,"humidity":71,"dew_point":295.35,"clouds":97,"wind_speed":2.74,"wind_deg":141,"weather":[{"id":804,"main":"Clouds","description":"overcast - clouds","icon":"04d"}]},{"dt":1589587200,"temp":299.64,"feels_like":302.77,"pressure":1010,"humidity":80,"dew_point":295.96,"clouds":91,"wind_speed":2.83,"wind_deg":121,"weather":[{"id":500,"main":"Rain","description":"light - rain","icon":"10d"}],"rain":{"1h":0.11}},{"dt":1589590800,"temp":297.47,"feels_like":299.59,"pressure":1010,"humidity":86,"dew_point":295.11,"clouds":100,"wind_speed":3.56,"wind_deg":112,"weather":[{"id":500,"main":"Rain","description":"light - rain","icon":"10d"}],"rain":{"1h":0.11}},{"dt":1589594400,"temp":295.95,"feels_like":297.2,"pressure":1010,"humidity":90,"dew_point":294.31,"clouds":83,"wind_speed":4.24,"wind_deg":117,"weather":[{"id":803,"main":"Clouds","description":"broken - clouds","icon":"04n"}]}],"daily":[{"dt":1589392800,"sunrise":1589368621,"sunset":1589418488,"temp":{"day":295.55,"min":293.67,"max":295.55,"night":293.67,"eve":295.55,"morn":295.55},"feels_like":{"day":293.69,"night":293.48,"eve":293.69,"morn":293.69},"pressure":1015,"humidity":64,"dew_point":288.41,"wind_speed":5.1,"wind_deg":134,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01n"}],"clouds":1,"uvi":10.31},{"dt":1589479200,"sunrise":1589454978,"sunset":1589504933,"temp":{"day":297.63,"min":291.42,"max":299.9,"night":293.76,"eve":298.17,"morn":291.42},"feels_like":{"day":297.87,"night":294.38,"eve":300.39,"morn":291.61},"pressure":1015,"humidity":79,"dew_point":293.94,"wind_speed":5.34,"wind_deg":169,"weather":[{"id":500,"main":"Rain","description":"light - rain","icon":"10d"}],"clouds":100,"rain":1.52,"uvi":9.98},{"dt":1589565600,"sunrise":1589541336,"sunset":1589591378,"temp":{"day":297.07,"min":293.02,"max":300.79,"night":293.8,"eve":299.64,"morn":293.02},"feels_like":{"day":298.99,"night":295.65,"eve":302.77,"morn":293.88},"pressure":1014,"humidity":86,"dew_point":294.65,"wind_speed":3.55,"wind_deg":169,"weather":[{"id":500,"main":"Rain","description":"light - rain","icon":"10d"}],"clouds":98,"rain":0.58,"uvi":10.53},{"dt":1589652000,"sunrise":1589627695,"sunset":1589677822,"temp":{"day":301.62,"min":292.14,"max":301.62,"night":292.14,"eve":294.72,"morn":293.44},"feels_like":{"day":303.51,"night":294.71,"eve":296.86,"morn":295.29},"pressure":1011,"humidity":64,"dew_point":294.16,"wind_speed":3.27,"wind_deg":166,"weather":[{"id":502,"main":"Rain","description":"heavy - intensity rain","icon":"10d"}],"clouds":96,"rain":16.78,"uvi":10.3},{"dt":1589738400,"sunrise":1589714056,"sunset":1589764267,"temp":{"day":298.29,"min":292.07,"max":298.6,"night":292.4,"eve":296.96,"morn":292.07},"feels_like":{"day":300.64,"night":293.17,"eve":300.43,"morn":293.94},"pressure":1012,"humidity":74,"dew_point":293.36,"wind_speed":2.04,"wind_deg":70,"weather":[{"id":501,"main":"Rain","description":"moderate - rain","icon":"10d"}],"clouds":99,"rain":8.01,"uvi":10.95},{"dt":1589824800,"sunrise":1589800419,"sunset":1589850710,"temp":{"day":298.65,"min":289.07,"max":300.81,"night":289.49,"eve":297.92,"morn":289.07},"feels_like":{"day":298.14,"night":288.35,"eve":298.74,"morn":288.15},"pressure":1015,"humidity":56,"dew_point":289.47,"wind_speed":3.6,"wind_deg":21,"weather":[{"id":802,"main":"Clouds","description":"scattered - clouds","icon":"03d"}],"clouds":49,"uvi":10.91},{"dt":1589911200,"sunrise":1589886783,"sunset":1589937154,"temp":{"day":296.27,"min":286.83,"max":298.28,"night":288.9,"eve":297.35,"morn":286.83},"feels_like":{"day":295.57,"night":288.28,"eve":299.19,"morn":286.03},"pressure":1015,"humidity":56,"dew_point":287.09,"wind_speed":2.73,"wind_deg":40,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01d"}],"clouds":0,"uvi":10.01},{"dt":1589997600,"sunrise":1589973148,"sunset":1590023597,"temp":{"day":298.21,"min":287.71,"max":299.71,"night":290.03,"eve":298.59,"morn":287.71},"feels_like":{"day":299.68,"night":289.89,"eve":301.62,"morn":287.74},"pressure":1014,"humidity":61,"dew_point":290.18,"wind_speed":1.3,"wind_deg":71,"weather":[{"id":800,"main":"Clear","description":"clear - sky","icon":"01d"}],"clouds":0,"uvi":10.16}]}' - http_version: null - recorded_at: Thu, 14 May 2020 03:09:08 GMT -recorded_with: VCR 5.1.0 + string: '{"lat":33.5312,"lon":-111.9426,"timezone":"America/Phoenix","timezone_offset":-25200,"current":{"dt":1704064820,"sunrise":1704033103,"sunset":1704068963,"temp":289.2,"feels_like":288.11,"pressure":1019,"humidity":48,"dew_point":278.2,"uvi":0.4,"clouds":0,"visibility":10000,"wind_speed":2.06,"wind_deg":110,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}]},"minutely":[{"dt":1704064860,"precipitation":0},{"dt":1704064920,"precipitation":0},{"dt":1704064980,"precipitation":0},{"dt":1704065040,"precipitation":0},{"dt":1704065100,"precipitation":0},{"dt":1704065160,"precipitation":0},{"dt":1704065220,"precipitation":0},{"dt":1704065280,"precipitation":0},{"dt":1704065340,"precipitation":0},{"dt":1704065400,"precipitation":0},{"dt":1704065460,"precipitation":0},{"dt":1704065520,"precipitation":0},{"dt":1704065580,"precipitation":0},{"dt":1704065640,"precipitation":0},{"dt":1704065700,"precipitation":0},{"dt":1704065760,"precipitation":0},{"dt":1704065820,"precipitation":0},{"dt":1704065880,"precipitation":0},{"dt":1704065940,"precipitation":0},{"dt":1704066000,"precipitation":0},{"dt":1704066060,"precipitation":0},{"dt":1704066120,"precipitation":0},{"dt":1704066180,"precipitation":0},{"dt":1704066240,"precipitation":0},{"dt":1704066300,"precipitation":0},{"dt":1704066360,"precipitation":0},{"dt":1704066420,"precipitation":0},{"dt":1704066480,"precipitation":0},{"dt":1704066540,"precipitation":0},{"dt":1704066600,"precipitation":0},{"dt":1704066660,"precipitation":0},{"dt":1704066720,"precipitation":0},{"dt":1704066780,"precipitation":0},{"dt":1704066840,"precipitation":0},{"dt":1704066900,"precipitation":0},{"dt":1704066960,"precipitation":0},{"dt":1704067020,"precipitation":0},{"dt":1704067080,"precipitation":0},{"dt":1704067140,"precipitation":0},{"dt":1704067200,"precipitation":0},{"dt":1704067260,"precipitation":0},{"dt":1704067320,"precipitation":0},{"dt":1704067380,"precipitation":0},{"dt":1704067440,"precipitation":0},{"dt":1704067500,"precipitation":0},{"dt":1704067560,"precipitation":0},{"dt":1704067620,"precipitation":0},{"dt":1704067680,"precipitation":0},{"dt":1704067740,"precipitation":0},{"dt":1704067800,"precipitation":0},{"dt":1704067860,"precipitation":0},{"dt":1704067920,"precipitation":0},{"dt":1704067980,"precipitation":0},{"dt":1704068040,"precipitation":0},{"dt":1704068100,"precipitation":0},{"dt":1704068160,"precipitation":0},{"dt":1704068220,"precipitation":0},{"dt":1704068280,"precipitation":0},{"dt":1704068340,"precipitation":0},{"dt":1704068400,"precipitation":0}],"hourly":[{"dt":1704063600,"temp":289.2,"feels_like":288.11,"pressure":1019,"humidity":48,"dew_point":278.2,"uvi":0.4,"clouds":0,"visibility":10000,"wind_speed":0.47,"wind_deg":175,"wind_gust":0.49,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}],"pop":0},{"dt":1704067200,"temp":289.12,"feels_like":287.97,"pressure":1019,"humidity":46,"dew_point":277.52,"uvi":0,"clouds":18,"visibility":10000,"wind_speed":0.7,"wind_deg":136,"wind_gust":0.82,"weather":[{"id":801,"main":"Clouds","description":"few + clouds","icon":"02d"}],"pop":0},{"dt":1704070800,"temp":288.9,"feels_like":287.68,"pressure":1019,"humidity":44,"dew_point":276.69,"uvi":0,"clouds":40,"visibility":10000,"wind_speed":1.32,"wind_deg":102,"wind_gust":1.71,"weather":[{"id":802,"main":"Clouds","description":"scattered + clouds","icon":"03n"}],"pop":0},{"dt":1704074400,"temp":288.55,"feels_like":287.29,"pressure":1019,"humidity":44,"dew_point":276.37,"uvi":0,"clouds":60,"visibility":10000,"wind_speed":1.47,"wind_deg":98,"wind_gust":2.15,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704078000,"temp":288.05,"feels_like":286.72,"pressure":1019,"humidity":43,"dew_point":275.59,"uvi":0,"clouds":78,"visibility":10000,"wind_speed":1.87,"wind_deg":91,"wind_gust":2.62,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704081600,"temp":287.21,"feels_like":285.82,"pressure":1019,"humidity":44,"dew_point":275.11,"uvi":0,"clouds":73,"visibility":10000,"wind_speed":1.36,"wind_deg":98,"wind_gust":1.55,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704085200,"temp":286.86,"feels_like":285.46,"pressure":1019,"humidity":45,"dew_point":275.15,"uvi":0,"clouds":59,"visibility":10000,"wind_speed":1.3,"wind_deg":75,"wind_gust":1.36,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704088800,"temp":286.56,"feels_like":285.16,"pressure":1019,"humidity":46,"dew_point":275.11,"uvi":0,"clouds":60,"visibility":10000,"wind_speed":1.51,"wind_deg":72,"wind_gust":1.58,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704092400,"temp":286.28,"feels_like":284.85,"pressure":1019,"humidity":46,"dew_point":275,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":1.63,"wind_deg":58,"wind_gust":1.67,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704096000,"temp":285.97,"feels_like":284.53,"pressure":1018,"humidity":47,"dew_point":274.8,"uvi":0,"clouds":88,"visibility":10000,"wind_speed":1.77,"wind_deg":51,"wind_gust":1.82,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704099600,"temp":285.64,"feels_like":284.17,"pressure":1018,"humidity":47,"dew_point":274.58,"uvi":0,"clouds":64,"visibility":10000,"wind_speed":1.95,"wind_deg":51,"wind_gust":2.02,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704103200,"temp":285.35,"feels_like":283.85,"pressure":1018,"humidity":47,"dew_point":274.33,"uvi":0,"clouds":71,"visibility":10000,"wind_speed":2.15,"wind_deg":46,"wind_gust":2.38,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704106800,"temp":285.08,"feels_like":283.56,"pressure":1018,"humidity":47,"dew_point":274.13,"uvi":0,"clouds":77,"visibility":10000,"wind_speed":2.02,"wind_deg":34,"wind_gust":2.22,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704110400,"temp":284.78,"feels_like":283.23,"pressure":1018,"humidity":47,"dew_point":273.89,"uvi":0,"clouds":80,"visibility":10000,"wind_speed":2.47,"wind_deg":66,"wind_gust":3.61,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704114000,"temp":284.46,"feels_like":282.87,"pressure":1018,"humidity":47,"dew_point":273.59,"uvi":0,"clouds":99,"visibility":10000,"wind_speed":2.66,"wind_deg":78,"wind_gust":4.78,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704117600,"temp":284.29,"feels_like":282.69,"pressure":1019,"humidity":47,"dew_point":273.3,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.38,"wind_deg":78,"wind_gust":4.39,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704121200,"temp":284.25,"feels_like":282.62,"pressure":1019,"humidity":46,"dew_point":273.05,"uvi":0,"clouds":96,"visibility":10000,"wind_speed":2.32,"wind_deg":77,"wind_gust":4.12,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"pop":0},{"dt":1704124800,"temp":285.15,"feels_like":283.53,"pressure":1019,"humidity":43,"dew_point":272.92,"uvi":0.45,"clouds":97,"visibility":10000,"wind_speed":1.84,"wind_deg":76,"wind_gust":3.17,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"pop":0},{"dt":1704128400,"temp":286.42,"feels_like":284.82,"pressure":1019,"humidity":39,"dew_point":272.58,"uvi":1.06,"clouds":98,"visibility":10000,"wind_speed":2.21,"wind_deg":78,"wind_gust":3.22,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"pop":0},{"dt":1704132000,"temp":287.5,"feels_like":285.9,"pressure":1019,"humidity":35,"dew_point":272.28,"uvi":1.46,"clouds":98,"visibility":10000,"wind_speed":2.39,"wind_deg":81,"wind_gust":3.22,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"pop":0},{"dt":1704135600,"temp":288.44,"feels_like":286.86,"pressure":1018,"humidity":32,"dew_point":271.9,"uvi":1.71,"clouds":100,"visibility":10000,"wind_speed":1.53,"wind_deg":96,"wind_gust":2.14,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"pop":0},{"dt":1704139200,"temp":288.87,"feels_like":287.31,"pressure":1017,"humidity":31,"dew_point":271.61,"uvi":1.6,"clouds":100,"visibility":10000,"wind_speed":1.24,"wind_deg":105,"wind_gust":1.79,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"pop":0},{"dt":1704142800,"temp":289.26,"feels_like":287.68,"pressure":1016,"humidity":29,"dew_point":271.32,"uvi":1.18,"clouds":100,"visibility":10000,"wind_speed":1.28,"wind_deg":129,"wind_gust":1.72,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"pop":0},{"dt":1704146400,"temp":289.43,"feels_like":287.87,"pressure":1016,"humidity":29,"dew_point":271.15,"uvi":0.64,"clouds":100,"visibility":10000,"wind_speed":1.52,"wind_deg":145,"wind_gust":1.9,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"pop":0},{"dt":1704150000,"temp":289.43,"feels_like":287.87,"pressure":1016,"humidity":29,"dew_point":271.27,"uvi":0.27,"clouds":100,"visibility":10000,"wind_speed":1.07,"wind_deg":129,"wind_gust":1.72,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"pop":0},{"dt":1704153600,"temp":288.98,"feels_like":287.4,"pressure":1016,"humidity":30,"dew_point":271.47,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":0.39,"wind_deg":242,"wind_gust":0.77,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"pop":0},{"dt":1704157200,"temp":288.24,"feels_like":286.61,"pressure":1016,"humidity":31,"dew_point":271.21,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":1.56,"wind_deg":285,"wind_gust":1.75,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704160800,"temp":287.92,"feels_like":286.26,"pressure":1016,"humidity":31,"dew_point":271.09,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":1.87,"wind_deg":282,"wind_gust":2.18,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704164400,"temp":287.63,"feels_like":285.97,"pressure":1016,"humidity":32,"dew_point":271.15,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.11,"wind_deg":285,"wind_gust":2.77,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704168000,"temp":287.2,"feels_like":285.52,"pressure":1017,"humidity":33,"dew_point":271.31,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.4,"wind_deg":286,"wind_gust":3.6,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704171600,"temp":286.74,"feels_like":285.07,"pressure":1017,"humidity":35,"dew_point":271.57,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.33,"wind_deg":286,"wind_gust":3.76,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704175200,"temp":286.31,"feels_like":284.67,"pressure":1018,"humidity":38,"dew_point":272.01,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.48,"wind_deg":285,"wind_gust":4.76,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704178800,"temp":285.98,"feels_like":284.36,"pressure":1018,"humidity":40,"dew_point":272.56,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.08,"wind_deg":262,"wind_gust":4.49,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704182400,"temp":285.95,"feels_like":284.33,"pressure":1018,"humidity":40,"dew_point":272.77,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.2,"wind_deg":230,"wind_gust":4.45,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704186000,"temp":285.28,"feels_like":283.7,"pressure":1018,"humidity":44,"dew_point":273.36,"uvi":0,"clouds":92,"visibility":10000,"wind_speed":1.82,"wind_deg":264,"wind_gust":4.41,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04n"}],"pop":0},{"dt":1704189600,"temp":284.89,"feels_like":283.32,"pressure":1019,"humidity":46,"dew_point":273.67,"uvi":0,"clouds":83,"visibility":10000,"wind_speed":0.2,"wind_deg":199,"wind_gust":0.96,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704193200,"temp":284.66,"feels_like":283.09,"pressure":1019,"humidity":47,"dew_point":273.67,"uvi":0,"clouds":78,"visibility":10000,"wind_speed":0.94,"wind_deg":125,"wind_gust":0.97,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704196800,"temp":284.32,"feels_like":282.75,"pressure":1019,"humidity":48,"dew_point":273.7,"uvi":0,"clouds":69,"visibility":10000,"wind_speed":0.84,"wind_deg":152,"wind_gust":0.97,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04n"}],"pop":0},{"dt":1704200400,"temp":284.07,"feels_like":282.5,"pressure":1020,"humidity":49,"dew_point":273.81,"uvi":0,"clouds":9,"visibility":10000,"wind_speed":0.61,"wind_deg":119,"wind_gust":0.77,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01n"}],"pop":0},{"dt":1704204000,"temp":283.81,"feels_like":282.26,"pressure":1021,"humidity":51,"dew_point":274.1,"uvi":0,"clouds":7,"visibility":10000,"wind_speed":1.05,"wind_deg":136,"wind_gust":1.35,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01n"}],"pop":0},{"dt":1704207600,"temp":283.76,"feels_like":282.29,"pressure":1022,"humidity":54,"dew_point":274.59,"uvi":0,"clouds":5,"visibility":10000,"wind_speed":1.74,"wind_deg":113,"wind_gust":2.26,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}],"pop":0},{"dt":1704211200,"temp":284.67,"feels_like":283.26,"pressure":1023,"humidity":53,"dew_point":275.2,"uvi":0.53,"clouds":4,"visibility":10000,"wind_speed":1.92,"wind_deg":121,"wind_gust":2.59,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}],"pop":0},{"dt":1704214800,"temp":285.6,"feels_like":284.23,"pressure":1023,"humidity":51,"dew_point":275.67,"uvi":1.34,"clouds":3,"visibility":10000,"wind_speed":2.16,"wind_deg":116,"wind_gust":2.59,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}],"pop":0},{"dt":1704218400,"temp":286.57,"feels_like":285.22,"pressure":1023,"humidity":48,"dew_point":275.62,"uvi":2.25,"clouds":2,"visibility":10000,"wind_speed":1.93,"wind_deg":125,"wind_gust":1.93,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}],"pop":0},{"dt":1704222000,"temp":287.24,"feels_like":285.85,"pressure":1022,"humidity":44,"dew_point":275.26,"uvi":2.89,"clouds":0,"visibility":10000,"wind_speed":1.23,"wind_deg":154,"wind_gust":0.9,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}],"pop":0},{"dt":1704225600,"temp":287.93,"feels_like":286.53,"pressure":1021,"humidity":41,"dew_point":274.88,"uvi":2.93,"clouds":0,"visibility":10000,"wind_speed":1.52,"wind_deg":232,"wind_gust":1.2,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}],"pop":0},{"dt":1704229200,"temp":288.65,"feels_like":287.25,"pressure":1020,"humidity":38,"dew_point":274.45,"uvi":2.31,"clouds":0,"visibility":10000,"wind_speed":2.21,"wind_deg":260,"wind_gust":2.08,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}],"pop":0},{"dt":1704232800,"temp":289.13,"feels_like":287.72,"pressure":1020,"humidity":36,"dew_point":274.05,"uvi":1.37,"clouds":0,"visibility":10000,"wind_speed":2.4,"wind_deg":275,"wind_gust":2.5,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}],"pop":0}],"daily":[{"dt":1704049200,"sunrise":1704033103,"sunset":1704068963,"moonrise":1704085320,"moonset":1704045000,"moon_phase":0.65,"temp":{"day":288.09,"min":284.09,"max":289.2,"night":286.56,"eve":288.9,"morn":284.42},"feels_like":{"day":286.79,"night":285.16,"eve":287.68,"morn":282.99},"pressure":1020,"humidity":44,"dew_point":275.95,"wind_speed":2.2,"wind_deg":109,"wind_gust":3.82,"weather":[{"id":802,"main":"Clouds","description":"scattered + clouds","icon":"03d"}],"clouds":37,"pop":0,"uvi":2.94},{"dt":1704135600,"sunrise":1704119516,"sunset":1704155406,"moonrise":1704175020,"moonset":1704132960,"moon_phase":0.68,"temp":{"day":288.44,"min":284.25,"max":289.43,"night":286.31,"eve":288.24,"morn":284.46},"feels_like":{"day":286.86,"night":284.67,"eve":286.61,"morn":282.87},"pressure":1018,"humidity":32,"dew_point":271.9,"wind_speed":2.66,"wind_deg":78,"wind_gust":4.78,"weather":[{"id":804,"main":"Clouds","description":"overcast + clouds","icon":"04d"}],"clouds":100,"pop":0,"uvi":1.71},{"dt":1704222000,"sunrise":1704205927,"sunset":1704241849,"moonrise":1704264720,"moonset":1704220800,"moon_phase":0.71,"temp":{"day":287.24,"min":283.76,"max":289.3,"night":286.22,"eve":288.27,"morn":284.07},"feels_like":{"day":285.85,"night":284.73,"eve":286.83,"morn":282.5},"pressure":1022,"humidity":44,"dew_point":275.26,"wind_speed":3.13,"wind_deg":280,"wind_gust":4.49,"weather":[{"id":800,"main":"Clear","description":"clear + sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":2.93},{"dt":1704308400,"sunrise":1704292337,"sunset":1704328294,"moonrise":0,"moonset":1704308580,"moon_phase":0.75,"temp":{"day":287.54,"min":284.29,"max":290.47,"night":287.05,"eve":290.47,"morn":284.36},"feels_like":{"day":285.87,"night":285.49,"eve":289.01,"morn":282.74},"pressure":1020,"humidity":32,"dew_point":271.26,"wind_speed":3.09,"wind_deg":139,"wind_gust":4.25,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04d"}],"clouds":56,"pop":0,"uvi":2.86},{"dt":1704394800,"sunrise":1704378745,"sunset":1704414740,"moonrise":1704354420,"moonset":1704396480,"moon_phase":0.77,"temp":{"day":286.19,"min":284.68,"max":287.62,"night":284.94,"eve":287.62,"morn":285.17},"feels_like":{"day":284.72,"night":283.43,"eve":286.14,"morn":283.63},"pressure":1015,"humidity":45,"dew_point":274.46,"wind_speed":3.31,"wind_deg":248,"wind_gust":4.2,"weather":[{"id":500,"main":"Rain","description":"light + rain","icon":"10d"}],"clouds":96,"pop":0.36,"rain":0.13,"uvi":2.47},{"dt":1704481200,"sunrise":1704465151,"sunset":1704501187,"moonrise":1704444240,"moonset":1704484440,"moon_phase":0.8,"temp":{"day":284.53,"min":282.38,"max":287,"night":284.87,"eve":287,"morn":282.91},"feels_like":{"day":283,"night":283.14,"eve":285.38,"morn":282.91},"pressure":1018,"humidity":49,"dew_point":274.15,"wind_speed":2.87,"wind_deg":259,"wind_gust":4.2,"weather":[{"id":500,"main":"Rain","description":"light + rain","icon":"10d"}],"clouds":1,"pop":0.34,"rain":0.13,"uvi":3},{"dt":1704567600,"sunrise":1704551555,"sunset":1704587635,"moonrise":1704534240,"moonset":1704572700,"moon_phase":0.83,"temp":{"day":285,"min":282.44,"max":287.64,"night":284.85,"eve":287.64,"morn":282.66},"feels_like":{"day":283.34,"night":283.38,"eve":286.01,"morn":281.6},"pressure":1017,"humidity":42,"dew_point":272.54,"wind_speed":3.89,"wind_deg":167,"wind_gust":7,"weather":[{"id":803,"main":"Clouds","description":"broken + clouds","icon":"04d"}],"clouds":80,"pop":0,"uvi":3},{"dt":1704654000,"sunrise":1704637958,"sunset":1704674084,"moonrise":1704624480,"moonset":1704661260,"moon_phase":0.87,"temp":{"day":281.65,"min":278.97,"max":284.16,"night":278.97,"eve":282.81,"morn":283.72},"feels_like":{"day":277.84,"night":277.45,"eve":280.57,"morn":282.84},"pressure":1006,"humidity":69,"dew_point":276.16,"wind_speed":9.58,"wind_deg":262,"wind_gust":14.02,"weather":[{"id":501,"main":"Rain","description":"moderate + rain","icon":"10d"}],"clouds":100,"pop":1,"rain":21.87,"uvi":3}],"alerts":[{"sender_name":"NWS + Phoenix (Central Arizona and California Desert)","event":"Air Quality Alert","start":1703871060,"end":1704168000,"description":"...PM-2.5 + HIGH POLLUTION ADVISORY FOR MARICOPA COUNTY INCLUDING THE\nPHOENIX METRO AREA + FOR SUNDAY AND MONDAY...\nThe Arizona Department of Environmental Quality + (ADEQ) has issued a\nPM-2.5 High Pollution Advisory for the Phoenix Metro + Area valid for\nSunday and Monday.\nThis means that ongoing stagnant weather + conditions combined with\nexisting airborne fine particulate levels may result + in local fine\nparticulate concentrations that pose a health risk. Adverse + health\neffects increase as air quality deteriorates.\nFine particulate matter + - also known as PM-2.5 - is an air\ncontaminant that can aggravate heart and + lung disease conditions,\nespecially in older adults, children, and those + with asthma. A\ndecrease in physical activity is recommended.\nThe Maricopa + County Air Quality Department has issued a No Burn Day.\nFireplace use and + outdoor burning is prohibited. Consolidate your\ntravel and avoid using gas-powered + lawn equipment.For more\ninformation on No Burn Days, visit, www.cleanairmakemore.com + or call\n602-506-6010.\nFor details on this High Pollution Advisory, visit + the ADEQ internet\nsite at www.azdeq.gov/forecast/phoenix or call 602-771-2300.","tags":["Air + quality"]}]}' + recorded_at: Sun, 31 Dec 2023 23:20:20 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/open_weather/one_call/one_call_spec.rb b/spec/open_weather/one_call/one_call_spec.rb index b94f106..b90745f 100644 --- a/spec/open_weather/one_call/one_call_spec.rb +++ b/spec/open_weather/one_call/one_call_spec.rb @@ -6,24 +6,43 @@ include_context 'API client' it 'lat, lon', vcr: { cassette_name: 'one_call/lat_lon' } do - data = client.one_call(lat: 33.441792, lon: -94.037689) + data = client.one_call(lat: 33.5312, lon: -111.9426) + expect(data).to be_a OpenWeather::Models::OneCall::Weather - expect(data.lat).to eq 33.44 - expect(data.lon).to eq(-94.04) - expect(data.timezone).to eq 'America/Chicago' + expect(data.lat).to eq 33.5312 + expect(data.lon).to eq(-111.9426) + expect(data.timezone).to eq 'America/Phoenix' expect(data.current).to be_a OpenWeather::Models::OneCall::CurrentWeather + + # Minutely expect(data.minutely).to be_a Array - expect(data.minutely.size).to eq 61 + expect(data.minutely.size).to eq 60 expect(data.minutely.first).to be_a OpenWeather::Models::OneCall::MinutelyWeather expect(data.minutely.first.precipitation).to eq 0 + + # Hourly expect(data.hourly).to be_a Array expect(data.hourly.size).to eq 48 expect(data.hourly.first).to be_a OpenWeather::Models::OneCall::HourlyWeather - expect(data.hourly.first.temp).to eq 295.55 + expect(data.hourly.first.temp).to eq 289.2 + + # Daily expect(data.daily).to be_a Array expect(data.daily.size).to eq 8 expect(data.daily.first).to be_a OpenWeather::Models::OneCall::DailyWeather - expect(data.daily.first.temp.night).to eq 293.67 + expect(data.daily.first.temp.night).to eq 286.56 + + # Alerts + data.alerts.first.tap do |alert| + expect(alert).to be_a OpenWeather::Models::OneCall::Alert + expect(alert.sender_name).to eq 'NWS Phoenix (Central Arizona and California Desert)' + expect(alert.event).to eq 'Air Quality Alert' + expect(alert.start).to be_a Time + expect(alert.end).to be_a Time + expect(alert.start.to_s).to eq '2023-12-29 17:31:00 UTC' + expect(alert.end.to_s).to eq '2024-01-02 04:00:00 UTC' + expect(alert.description).to include '...PM-2.5 HIGH POLLUTION ADVISORY FOR MARICOPA COUNTY' + end end it 'lat, lon, excluding minutely and hourly', vcr: { cassette_name: 'one_call/lat_lon_exclude_minutely_hourly' } do