Buienradar binding: store lat/lon with 2-digit precision

Tags: #<Tag:0x00007f616ae0f3a8> #<Tag:0x00007f616ae0f2e0>

The buienradar widget makes use of the following web service URI: gpsgadget.buienradar.nl/data/raintext?lat=XX.XXXXX&lon=YY.YYYYY

When manually fetching the forecast info, I noticed that the web service redirects to (lat, lon) coodinates with 2-digit precision, i.e.: gpsgadget.buienradar.nl/data/raintext?lat=XX.XX&lon=YY.YY

This may explain why the buienradar binding frequently misses out on fetching forecast info.

I recommend that the buienradar binding converts the (lat, lon) coordinates provided for the binding to 2-digit precision when constructing the URL to eliminate one HTTPS request.

As a work-around I now stored the (lat, lon) coordinates with 2-digit precision for the Buienradar binding via Paper UI, but this isn’t 100% water proof as floating point numbers may automagically be stored with a higher precision due to floating point conversion.

The only fix is to edit the URI and replace "%.8f" with "%.2f" for lat and for lon.

See also: