@@ -16,8 +21,8 @@
{% endif %}
- {% if config.showHumidity and current.humidity %}
-
+ {% if config.showHumidity === "wind" %}
+ {{ humidity() }}
{% endif %}
{% if config.showSun %}
{% if config.showIndoorTemperature and indoor.temperature %}
@@ -59,6 +67,9 @@
{% if config.showFeelsLike %}
+ {% if config.showHumidity === "feelslike" %}
+ {{ humidity() }}
+ {% endif %}
{{ "FEELS" | translate({DEGREE: current.feelsLike() | roundValue | unit("temperature") | decimalSymbol }) }}
@@ -76,6 +87,9 @@
{% endif %}
{% endif %}
+ {% if config.showHumidity === "below" %}
+
{{ humidity() }}
+ {% endif %}
{% else %}
{{ "LOADING" | translate }}
{% endif %}
diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js
index f4149652..f6925625 100644
--- a/modules/default/weather/weather.js
+++ b/modules/default/weather/weather.js
@@ -14,7 +14,7 @@ Module.register("weather", {
updateInterval: 10 * 60 * 1000, // every 10 minutes
animationSpeed: 1000,
showFeelsLike: true,
- showHumidity: false,
+ showHumidity: "none", // this is now a string; see current.njk
showIndoorHumidity: false,
showIndoorTemperature: false,
allowOverrideNotification: false,
@@ -80,6 +80,10 @@ Module.register("weather", {
Log.warn("Your are using the deprecated config values 'useBeaufort'. Please switch to windUnits!");
this.windUnits = "beaufort";
}
+ if (typeof this.config.showHumidity === "boolean") {
+ Log.warn("[weather] Deprecation warning: Please consider updating showHumidity to the new style (config string).");
+ this.config.showHumidity = this.config.showHumidity ? "wind" : "none";
+ }
// Initialize the weather provider.
this.weatherProvider = WeatherProvider.initialize(this.config.weatherProvider, this);
diff --git a/tests/configs/modules/weather/currentweather_default.js b/tests/configs/modules/weather/currentweather_default.js
index cd02cdec..b6601aa3 100644
--- a/tests/configs/modules/weather/currentweather_default.js
+++ b/tests/configs/modules/weather/currentweather_default.js
@@ -7,6 +7,7 @@ let config = {
position: "bottom_bar",
config: {
location: "Munich",
+ showHumidity: "feelslike",
mockData: '"#####WEATHERDATA#####"'
}
}
diff --git a/tests/configs/modules/weather/currentweather_options.js b/tests/configs/modules/weather/currentweather_options.js
index 5ad748e4..f7c2e3f1 100644
--- a/tests/configs/modules/weather/currentweather_options.js
+++ b/tests/configs/modules/weather/currentweather_options.js
@@ -9,7 +9,7 @@ let config = {
windUnits: "beaufort",
showWindDirectionAsArrow: true,
showSun: false,
- showHumidity: true,
+ showHumidity: "wind",
roundTemp: true,
degreeLabel: true
}
diff --git a/tests/configs/modules/weather/currentweather_units.js b/tests/configs/modules/weather/currentweather_units.js
index a51bb58a..eedbc37d 100644
--- a/tests/configs/modules/weather/currentweather_units.js
+++ b/tests/configs/modules/weather/currentweather_units.js
@@ -9,7 +9,7 @@ let config = {
location: "Munich",
mockData: '"#####WEATHERDATA#####"',
decimalSymbol: ",",
- showHumidity: true
+ showHumidity: "wind"
}
}
]
diff --git a/tests/e2e/modules/weather_current_spec.js b/tests/e2e/modules/weather_current_spec.js
index cc9ea38f..ac66873b 100644
--- a/tests/e2e/modules/weather_current_spec.js
+++ b/tests/e2e/modules/weather_current_spec.js
@@ -23,7 +23,11 @@ describe("Weather module", () => {
});
it("should render feels like temperature", async () => {
- await expect(weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed", "Feels like -5.6°")).resolves.toBe(true);
+ // Template contains which renders as \xa0
+ await expect(weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed", "93.7\xa0 Feels like -5.6°")).resolves.toBe(true);
+ });
+ it("should render humidity next to feels-like", async () => {
+ await expect(weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed .humidity", "93.7")).resolves.toBe(true);
});
});
});
@@ -53,8 +57,8 @@ describe("Weather module", () => {
expect(elem.outerHTML).toContain("transform:rotate(250deg)");
});
- it("should render humidity", async () => {
- await expect(weatherFunc.getText(".weather .normal.medium span:nth-child(3)", "93.7")).resolves.toBe(true);
+ it("should render humidity next to wind", async () => {
+ await expect(weatherFunc.getText(".weather .normal.medium .humidity", "93.7")).resolves.toBe(true);
});
it("should render degreeLabel for temp", async () => {