- HourlyDT[i] = HourlyForecasts[i].dt = hourly[i]["dt"].as<int>();
- HourlyTemp[i] = HourlyForecasts[i].temp = hourly[i]["temp"].as<float>();
- HourlyFeelsLike[i] = HourlyForecasts[i].feels_like = hourly[i]["feels_like"].as<float>();
- HourlyPressure[i] = HourlyForecasts[i].pressure = 0.75 * hourly[i]["pressure"].as<float>();
- HourlyHumidity[i] = HourlyForecasts[i].humidity = hourly[i]["humidity"].as<float>();
- HourlyClouds[i] = HourlyForecasts[i].clouds = hourly[i]["clouds"].as<float>();
- HourlyWindSpeed[i] = HourlyForecasts[i].wind_speed = hourly[i]["wind_speed"].as<float>();
- HourlyForecasts[i].wind_deg = hourly[i]["wind_deg"].as<float>();
- HourlyRain[i] = HourlyForecasts[i].rain = hourly[i]["rain"]["1h"].as<float>();
- HourlySnow[i] = HourlyForecasts[i].snow = hourly[i]["snow"]["1h"].as<float>();
- HourlyPrecip[i] = HourlyRain[i] + HourlySnow[i];
- HourlyForecasts[i].description = hourly[i]["weather"][0]["description"].as<char*>();
- HourlyForecasts[i].icon = hourly[i]["weather"][0]["icon"].as<char*>();
- }
-
- JsonArray daily = root["daily"];
- for (byte i=0; i<MaxDailyFC; i++) {
- DailyDT[i] = DailyForecasts[i].dt = daily[i]["dt"].as<int>();
- DailyTempMin[i] = DailyForecasts[i].temp_min = daily[i]["temp"]["min"].as<float>();
- DailyFeelsLikeMin[i] = DailyForecasts[i].feels_like_min = daily[i]["feels_like"]["min"].as<float>();
- DailyTempMax[i] = DailyForecasts[i].temp_max = daily[i]["temp"]["max"].as<float>();
- DailyFeelsLikeMax[i] = DailyForecasts[i].feels_like_max = daily[i]["feels_like"]["max"].as<float>();
- DailyPressure[i] = DailyForecasts[i].pressure = 0.75 * daily[i]["pressure"].as<float>();
- DailyHumidity[i] = DailyForecasts[i].humidity = daily[i]["humidity"].as<float>();
- DailyClouds[i] = DailyForecasts[i].clouds = daily[i]["clouds"].as<float>();
- DailyWindSpeed[i] = DailyForecasts[i].wind_speed = daily[i]["wind_speed"].as<float>();
- DailyForecasts[i].wind_deg = daily[i]["wind_deg"].as<float>();
- DailyRain[i] = DailyForecasts[i].rain = daily[i]["rain"].as<float>();
- DailySnow[i] = DailyForecasts[i].snow = daily[i]["snow"].as<float>();
- DailyPrecip[i] = DailyRain[i] + DailySnow[i];
- DailyForecasts[i].description = daily[i]["weather"][0]["description"].as<char*>();
- DailyForecasts[i].icon = daily[i]["weather"][0]["icon"].as<char*>();
+ HourlyDT[i] = HourlyForecasts[i].dt = root["hourly"]["time"][i+offset].as<int>();
+ HourlyTemp[i] = HourlyForecasts[i].temp = root["hourly"]["temperature_2m"][i+offset].as<float>();
+ HourlyFeelsLike[i] = HourlyForecasts[i].feels_like = root["hourly"]["apparent_temperature"][i+offset].as<float>();
+ HourlyPressure[i] = HourlyForecasts[i].pressure = 0.75 * root["hourly"]["surface_pressure"][i+offset].as<float>();
+ HourlyHumidity[i] = HourlyForecasts[i].humidity = root["hourly"]["relative_humidity_2m"][i+offset].as<float>();
+ HourlyWindSpeed[i] = HourlyForecasts[i].wind_speed = root["hourly"]["wind_speed_10m"][i+offset].as<float>();
+ HourlyForecasts[i].wind_deg = root["hourly"]["wind_direction_10m"][i+offset].as<float>();
+ HourlyPrecip[i] = HourlyForecasts[i].precip = root["hourly"]["precipitation"][i+offset].as<float>();
+ HourlyForecasts[i].wmo = root["hourly"]["weather_code"][i+offset].as<int>();