Added feels like clockInfo

master
RKBoss6 2025-06-28 21:13:56 -04:00 committed by GitHub
parent 873a19af81
commit b8854ab20d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,4 @@
(function() {
var weather;
var weatherLib = require("weather");
@ -6,6 +7,7 @@
weather = weatherLib.get();
if(weather){
weather.temp = require("locale").temp(weather.temp-273.15);
weather.feels = require("locale").temp(weather.feels-273.15);
weather.hum = weather.hum + "%";
weather.wind = require("locale").speed(weather.wind).match(/^(\D*\d*)(.*)$/);
weather.wind = Math.round(weather.wind[1]) + "kph";
@ -14,6 +16,7 @@
temp: "?",
hum: "?",
wind: "?",
feels: "?",
txt: "?",
};
}
@ -50,7 +53,7 @@
weatherLib.on("update", this.updater);
},
hide: function () { weatherLib.removeListener("update", this.updater); }
,run : function() {load("weather.app.js");}
,run : function() {load("weather.app.js");}
},
{
name: "condition",
@ -62,7 +65,7 @@
weatherLib.on("update", this.updater);
},
hide: function () { weatherLib.removeListener("update", this.updater); }
,run : function() {load("weather.app.js");}
,run : function() {load("weather.app.js");}
},
{
name: "temperature",
@ -74,7 +77,19 @@
weatherLib.on("update", this.updater);
},
hide: function () { weatherLib.removeListener("update", this.updater); }
,run : function() {load("weather.app.js");}
,run : function() {load("weather.app.js");}
},
{
name: "feelsLike",
hasRange : true,
get: () => ({ text: weather.feels, img: atob("GBiBAAAAAAHAAAPgAAfgAAfgAAfg4APhsAfxEB/5EB/5ED/9ED/9ED/9ED/9ED/9EB/9UB/7UA/yyAf26Afk7AfmyAfjGAfh8AAAAA=="),
v: parseInt(weather.temp), min: -30, max: 55}),
show: function() {
this.updater = _updater.bind(this);
weatherLib.on("update", this.updater);
},
hide: function () { weatherLib.removeListener("update", this.updater); }
,run : function() {load("weather.app.js");}
},
{
name: "humidity",
@ -86,7 +101,7 @@
weatherLib.on("update", this.updater);
},
hide: function () { weatherLib.removeListener("update", this.updater); }
,run : function() {load("weather.app.js");}
,run : function() {load("weather.app.js");}
},
{
name: "wind",
@ -98,7 +113,7 @@
weatherLib.on("update", this.updater);
},
hide: function () { weatherLib.removeListener("update", this.updater); }
,run : function() {load("weather.app.js");}
,run : function() {load("weather.app.js");}
},
]
};