Update app.js

Final fix
pull/1066/head
lunctis-viribus 2021-12-12 10:36:34 +01:00 committed by GitHub
parent 001d1763dd
commit a4d028f63e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -102,13 +102,12 @@ function draw() {
clockLayout.dow.label = locale.dow(date, 1).toUpperCase() + " ";
var weatherJson = getWeather();
if(weatherJson && weatherJson.weather){
var currentWeather = weatherJson.weather;
var currentWeather = weatherJson.weather;
const temp = locale.temp(currentWeather.temp-273.15).match(/^(\D*\d*)(.*)$/);
clockLayout.temp.label = temp[1] + " " + temp[2];
clockLayout.weatherIcon.src = chooseIcon(currentWeather.txt);
const wind = locale.speed(currentWeather.wind).match(/^(\D*\d*)(.*)$/);
clockLayout.wind.label = wind[1] + " " + wind[2] + " " + (currentWeather.wrose||'').toUpperCase();
var currentWeather = weatherJson.weather;
}
else{
clockLayout.temp.label = "Err";