From 97b96114d55378cf46b35f0e6032214e19a29e11 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Sat, 2 Jul 2022 16:52:42 +0200 Subject: [PATCH] owmweather - Get location on every pull --- apps/owmweather/boot.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/owmweather/boot.js b/apps/owmweather/boot.js index e2551c646..123d83842 100644 --- a/apps/owmweather/boot.js +++ b/apps/owmweather/boot.js @@ -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){