For example, I am using OpenWeather. Now those API calls seem to return metric units (for example meters per second for wind speed) by default. The API caller can request imperial (miles per hour) by appending &units=imperial to the URL.
Within KLWP, my settings are for units to be automatic. As I am in the USA, I expect the results to me, for example, in MPH. Can someone explain what is being done inside of KLWP when things are automatic?
As far as I know, KLWP uses local unit, based on our own location (or phone's location).
Have you tried to use this formula to get local unit?
Alternatively, you can use if() formula to check the unit and display the converted value (ie. wind speed).
mph ➞ km/h
$if(li(spdu)=mph, 1.61*wi(wspeed), wi(wspeed))$km/h
km/h ➞ mph
$if(li(spdu)=mph, wi(wspeed), 0.62*wi(wspeed))$mph
Hope this helps.
Thanks but this proves incorrect. I checked the logcat and found KLWP making the following calls. So as you can now see, Kustom is specifically requesting results always in metric. Now, it is possible that it internally converts them to the current locale. But that was not my question. Cheers