mirror of https://github.com/espruino/BangleApps
Addressed undefined weather timestamp
parent
cb8e733738
commit
6439062d92
|
@ -1,2 +1,3 @@
|
||||||
0.01: New App!
|
0.01: New App!
|
||||||
0.02: Get weather from weather.json
|
0.02: Get weather from weather.json
|
||||||
|
0.03: Address unexpected undefined when reading weather.json
|
|
@ -326,7 +326,7 @@ function setWeather() {
|
||||||
function readWeather() {
|
function readWeather() {
|
||||||
var weatherJson = require("Storage").readJSON('weather.json', 1);
|
var weatherJson = require("Storage").readJSON('weather.json', 1);
|
||||||
// save updated weather data if available and it has been an hour since last updated
|
// save updated weather data if available and it has been an hour since last updated
|
||||||
if (weatherJson !== undefined && (data.time === undefined || (data.time + 3600000) < weatherJson.weather.time)) {
|
if (weatherJson && weatherJson.weather && weatherJson.weather.time && (data.time === undefined || (data.time + 3600000) < weatherJson.weather.time)) {
|
||||||
data = {
|
data = {
|
||||||
time: weatherJson.weather.time,
|
time: weatherJson.weather.time,
|
||||||
temp: weatherJson.weather.temp,
|
temp: weatherJson.weather.temp,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "mtnclock",
|
"id": "mtnclock",
|
||||||
"name": "Mountain Pass Clock",
|
"name": "Mountain Pass Clock",
|
||||||
"shortName": "Mtn Clock",
|
"shortName": "Mtn Clock",
|
||||||
"version": "0.02",
|
"version": "0.03",
|
||||||
"description": "A clock that changes scenery based on time and weather.",
|
"description": "A clock that changes scenery based on time and weather.",
|
||||||
"readme":"README.md",
|
"readme":"README.md",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
|
|
Loading…
Reference in New Issue