mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 21:00:57 +00:00
Fix precipitation styles (#3041)
They weren't applied to wrong classnames, this PR fixes that and also expands the weather util tests --------- Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
@@ -12,7 +12,7 @@ const WeatherUtils = {
|
||||
* @returns {number} the speed in beaufort
|
||||
*/
|
||||
beaufortWindSpeed(speedInMS) {
|
||||
const windInKmh = (speedInMS * 3600) / 1000;
|
||||
const windInKmh = this.convertWind(speedInMS, "kmh");
|
||||
const speeds = [1, 5, 11, 19, 28, 38, 49, 61, 74, 88, 102, 117, 1000];
|
||||
for (const [index, speed] of speeds.entries()) {
|
||||
if (speed > windInKmh) {
|
||||
@@ -40,6 +40,8 @@ const WeatherUtils = {
|
||||
valueUnit = valueUnit ? valueUnit : "mm";
|
||||
}
|
||||
|
||||
if (valueUnit === "%") return `${value}${valueUnit}`;
|
||||
|
||||
return `${value.toFixed(2)} ${valueUnit}`;
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user