forked from FOSS/BangleApps
Minor fix.
parent
5c9f84d00e
commit
ce1d0a4e96
|
@ -482,31 +482,31 @@ function getWeather(){
|
||||||
// Return default
|
// Return default
|
||||||
}
|
}
|
||||||
|
|
||||||
if(weatherJson){
|
if(weatherJson === undefined){
|
||||||
var weather = weatherJson.weather;
|
return {
|
||||||
|
temp: "-",
|
||||||
// Temperature
|
hum: "-",
|
||||||
const temp = locale.temp(weather.temp-273.15).match(/^(\D*\d*)(.*)$/);
|
txt: "-",
|
||||||
weather.temp = temp[1] + " " + temp[2].toUpperCase();
|
wind: "-",
|
||||||
|
wdir: "-",
|
||||||
// Humidity
|
wrose: "-"
|
||||||
weather.hum = weather.hum + "%";
|
};
|
||||||
|
|
||||||
// Wind
|
|
||||||
const wind = locale.speed(weather.wind).match(/^(\D*\d*)(.*)$/);
|
|
||||||
weather.wind = wind[1] + wind[2].toUpperCase();
|
|
||||||
|
|
||||||
return weather
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
var weather = weatherJson.weather;
|
||||||
temp: "-",
|
|
||||||
hum: "-",
|
// Temperature
|
||||||
txt: "-",
|
const temp = locale.temp(weather.temp-273.15).match(/^(\D*\d*)(.*)$/);
|
||||||
wind: "-",
|
weather.temp = temp[1] + " " + temp[2].toUpperCase();
|
||||||
wdir: "-",
|
|
||||||
wrose: "-"
|
// Humidity
|
||||||
};
|
weather.hum = weather.hum + "%";
|
||||||
|
|
||||||
|
// Wind
|
||||||
|
const wind = locale.speed(weather.wind).match(/^(\D*\d*)(.*)$/);
|
||||||
|
weather.wind = wind[1]; // + wind[2].toUpperCase(); // Don't show mph - its too large
|
||||||
|
|
||||||
|
return weather
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue