diff --git a/apps/ios/boot.js b/apps/ios/boot.js index 832a95374..4bdf71b57 100644 --- a/apps/ios/boot.js +++ b/apps/ios/boot.js @@ -160,7 +160,6 @@ E.on('notify',msg=>{ }; var replacer = ""; //(n)=>print('Unknown unicode '+n.toString(16)); //if (appNames[msg.appId]) msg.a - Terminal.println("'" + msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer) + "'"); if (msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer) === "BangleDumpCalendar") { // parse the message body into json: const d = JSON.parse(msg.message); @@ -205,6 +204,7 @@ E.on('notify',msg=>{ return; } if (msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer) === "BangleDumpWeather") { + Terminal.println("Weather"); const d = JSON.parse(msg.message); /* Example: {"temp":"291.07","hi":"293.02","lo":"288.18","hum":"49","rain":"0","uv":"0","wind":"1.54","code":"01d","txt":"Mostly Sunny","wdir":"303","loc":"Berlin"} @@ -226,7 +226,6 @@ E.on('notify',msg=>{ loc: d.loc } require("weather").update(weatherEvent); - Terminal.println("received weather data"); NRF.ancsAction(msg.uid, false); return; } diff --git a/apps/weather/lib.js b/apps/weather/lib.js index af6aa4d7e..9505cbafe 100644 --- a/apps/weather/lib.js +++ b/apps/weather/lib.js @@ -36,11 +36,12 @@ function update(weatherEvent) { delete json.weather; } + storage.write('weather.json', json); scheduleExpiry(json); exports.emit("update", json.weather); } - +exports.update = update; const _GB = global.GB; global.GB = (event) => { if (event.t==="weather") update(event);