mirror of https://github.com/espruino/BangleApps
owmweather - Get location on every pull
parent
650af83736
commit
97b96114d5
|
@ -4,16 +4,15 @@
|
||||||
enabled: false
|
enabled: false
|
||||||
};
|
};
|
||||||
if (settings.enabled) {
|
if (settings.enabled) {
|
||||||
let location = require("Storage").readJSON("mylocation.json", 1) || {
|
|
||||||
"lat": 51.50,
|
|
||||||
"lon": 0.12,
|
|
||||||
"location": "London"
|
|
||||||
};
|
|
||||||
|
|
||||||
Bangle.pullOwmWeather = function(force, completionCallback) {
|
Bangle.pullOwmWeather = function(force, completionCallback) {
|
||||||
if (!force && responsePromise){
|
if (!force && responsePromise){
|
||||||
return;
|
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 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;
|
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){
|
if (Bangle.http){
|
||||||
|
|
Loading…
Reference in New Issue