owmweather - Get location on every pull

pull/1969/head
Martin Boonk 2022-07-02 16:52:42 +02:00
parent 650af83736
commit 97b96114d5
1 changed files with 5 additions and 6 deletions

View File

@ -4,16 +4,15 @@
enabled: false
};
if (settings.enabled) {
let location = require("Storage").readJSON("mylocation.json", 1) || {
"lat": 51.50,
"lon": 0.12,
"location": "London"
};
Bangle.pullOwmWeather = function(force, completionCallback) {
if (!force && responsePromise){
return;
}
let location = require("Storage").readJSON("mylocation.json", 1) || {
"lat": 51.50,
"lon": 0.12,
"location": "London"
};
let settings = require("Storage").readJSON("owmweather.json", 1);
let uri = "https://api.openweathermap.org/data/2.5/weather?lat=" + location.lat.toFixed(2) + "&lon=" + location.lon.toFixed(2) + "&exclude=hourly,daily&appid=" + settings.apikey;
if (Bangle.http){