NielsMasdorp / Speculum-Android

[Not maintained] Android application powering a magic mirror.
MIT License
330 stars 71 forks source link

Forecast in App Not Matching Darksky #43

Open indyrunner03 opened 7 years ago

indyrunner03 commented 7 years ago

The forecast in the app is not matching the data displayed on Darksky's site. It appears to be averaging the temp between the high/low ((44F + 55F)/2 = 49.5, app displays 49F as the temp). If I check the actual values on Darksky both through the UI and the API (by plugging in the appropriate Longitude/Latitude coordinates) everything looks correct. But, again, through the app it appears as the average of the High and Low temps.

indyrunner03 commented 7 years ago

I found in the "ForecastIOService.java" file where it's doing this:

    int intTemp = (f.getTemperatureMin().intValue() + f.getTemperatureMax().intValue()) / 2;

The average temp doesn't provide any value if you swing from a high of 79F and a low of 50F (avg of 64.5F) which isn't an uncommon occurrence. I removed the calculation to simply display the high temp. I might reconfigure the app to display both the high and the low.