mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-29 05:16:51 +01:00
GenericWeatherReceiver: use forecast source for uvIndex and precipProbability
This commit is contained in:
parent
6fb951db6b
commit
0da552aa33
@ -96,8 +96,8 @@ public class GenericWeatherReceiver extends BroadcastReceiver {
|
|||||||
forecast.minTemp = safelyGet(forecastJson, Integer.class, "minTemp", 0);
|
forecast.minTemp = safelyGet(forecastJson, Integer.class, "minTemp", 0);
|
||||||
forecast.windSpeed = safelyGet(forecastJson, Number.class, "windSpeed", 0).floatValue();
|
forecast.windSpeed = safelyGet(forecastJson, Number.class, "windSpeed", 0).floatValue();
|
||||||
forecast.windDirection = safelyGet(forecastJson, Integer.class, "windDirection", 0);
|
forecast.windDirection = safelyGet(forecastJson, Integer.class, "windDirection", 0);
|
||||||
forecast.uvIndex = safelyGet(weatherJson, Number.class, "uvIndex", 0d).floatValue();
|
forecast.uvIndex = safelyGet(forecastJson, Number.class, "uvIndex", 0d).floatValue();
|
||||||
forecast.precipProbability = safelyGet(weatherJson, Integer.class, "precipProbability", 0);
|
forecast.precipProbability = safelyGet(forecastJson, Integer.class, "precipProbability", 0);
|
||||||
forecast.sunRise = safelyGet(forecastJson, Integer.class, "sunRise", 0);
|
forecast.sunRise = safelyGet(forecastJson, Integer.class, "sunRise", 0);
|
||||||
forecast.sunSet = safelyGet(forecastJson, Integer.class, "sunSet", 0);
|
forecast.sunSet = safelyGet(forecastJson, Integer.class, "sunSet", 0);
|
||||||
forecast.moonRise = safelyGet(forecastJson, Integer.class, "moonRise", 0);
|
forecast.moonRise = safelyGet(forecastJson, Integer.class, "moonRise", 0);
|
||||||
@ -127,8 +127,8 @@ public class GenericWeatherReceiver extends BroadcastReceiver {
|
|||||||
forecast.humidity = safelyGet(forecastJson, Integer.class, "humidity", 0);
|
forecast.humidity = safelyGet(forecastJson, Integer.class, "humidity", 0);
|
||||||
forecast.windSpeed = safelyGet(forecastJson, Number.class, "windSpeed", 0).floatValue();
|
forecast.windSpeed = safelyGet(forecastJson, Number.class, "windSpeed", 0).floatValue();
|
||||||
forecast.windDirection = safelyGet(forecastJson, Integer.class, "windDirection", 0);
|
forecast.windDirection = safelyGet(forecastJson, Integer.class, "windDirection", 0);
|
||||||
forecast.uvIndex = safelyGet(weatherJson, Number.class, "uvIndex", 0d).floatValue();
|
forecast.uvIndex = safelyGet(forecastJson, Number.class, "uvIndex", 0d).floatValue();
|
||||||
forecast.precipProbability = safelyGet(weatherJson, Integer.class, "precipProbability", 0);
|
forecast.precipProbability = safelyGet(forecastJson, Integer.class, "precipProbability", 0);
|
||||||
|
|
||||||
weatherSpec.hourly.add(forecast);
|
weatherSpec.hourly.add(forecast);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user