From 81aab7e86f7ea5dfbc0de2ea2b09857723527f39 Mon Sep 17 00:00:00 2001 From: Adi Miller Date: Thu, 16 Jan 2020 16:26:20 +0200 Subject: [PATCH 1/2] Added the ability to hide the temp label and weather icon in the `currentweather` module to allow showing only information such as wind and sunset/rise. --- CHANGELOG.md | 3 +- .../default/currentweather/currentweather.js | 55 ++++++++++--------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7e63e7e..476264b8 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). - cleanup installers folder, remove externalized scripts ### Added -- Finnish translation for "PRECIP", "UPDATE_INFO_MULTIPLE" and "UPDATE_INFO_SINGLE". +- Finish translation for "PRECIP", "UPDATE_INFO_MULTIPLE" and "UPDATE_INFO_SINGLE". +- Added the ability to hide the temp label and weather icon in the `currentweather` module to allow showing only information such as wind and sunset/rise. ### Fixed - Force declaration of public ip adress in config file (ISSUE #1852) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 7d917132..dcf771af 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -44,6 +44,7 @@ Module.register("currentweather",{ calendarClass: "calendar", onlyTemp: false, + hideTemp: false, roundTemp: false, iconTable: { @@ -194,36 +195,38 @@ Module.register("currentweather",{ var large = document.createElement("div"); large.className = "large light"; - var weatherIcon = document.createElement("span"); - weatherIcon.className = "wi weathericon " + this.weatherType; - large.appendChild(weatherIcon); + if (this.config.hideTemp === true) { + var weatherIcon = document.createElement("span"); + weatherIcon.className = "wi weathericon " + this.weatherType; + large.appendChild(weatherIcon); - var degreeLabel = ""; - if (this.config.units === "metric" || this.config.units === "imperial") { - degreeLabel += "°"; - } - if(this.config.degreeLabel) { - switch(this.config.units) { - case "metric": - degreeLabel += "C"; - break; - case "imperial": - degreeLabel += "F"; - break; - case "default": - degreeLabel += "K"; - break; + var degreeLabel = ""; + if (this.config.units === "metric" || this.config.units === "imperial") { + degreeLabel += "°"; + } + if(this.config.degreeLabel) { + switch(this.config.units) { + case "metric": + degreeLabel += "C"; + break; + case "imperial": + degreeLabel += "F"; + break; + case "default": + degreeLabel += "K"; + break; + } } - } - if (this.config.decimalSymbol === "") { - this.config.decimalSymbol = "."; - } + if (this.config.decimalSymbol === "") { + this.config.decimalSymbol = "."; + } - var temperature = document.createElement("span"); - temperature.className = "bright"; - temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + degreeLabel; - large.appendChild(temperature); + var temperature = document.createElement("span"); + temperature.className = "bright"; + temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + degreeLabel; + large.appendChild(temperature); + } if (this.config.showIndoorTemperature && this.indoorTemperature) { var indoorIcon = document.createElement("span"); From 63950f572a2ebc30fcad25fc2e52ca64679754a7 Mon Sep 17 00:00:00 2001 From: Adi Miller Date: Thu, 16 Jan 2020 16:47:49 +0200 Subject: [PATCH 2/2] Adding trailing enter to avoid build warning. --- modules/default/alert/README.md | 2 +- modules/default/calendar/README.md | 2 +- modules/default/clock/README.md | 2 +- modules/default/compliments/README.md | 2 +- modules/default/currentweather/README.md | 2 +- modules/default/helloworld/README.md | 2 +- modules/default/newsfeed/README.md | 2 +- modules/default/updatenotification/README.md | 2 +- modules/default/weather/README.md | 2 +- modules/default/weatherforecast/README.md | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/default/alert/README.md b/modules/default/alert/README.md index 3bd5d00d..4d3c6a65 100644 --- a/modules/default/alert/README.md +++ b/modules/default/alert/README.md @@ -1,4 +1,4 @@ # Module: Alert The alert module is one of the default modules of the MagicMirror. This module displays notifications from other modules. -For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/alert.html). \ No newline at end of file +For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/alert.html). diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index fbb8bfd9..5c8f187b 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -2,4 +2,4 @@ The `calendar` module is one of the default modules of the MagicMirror. This module displays events from a public .ical calendar. It can combine multiple calendars. -For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/calendar.html). \ No newline at end of file +For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/calendar.html). diff --git a/modules/default/clock/README.md b/modules/default/clock/README.md index 1c0bdf8c..34a1448d 100644 --- a/modules/default/clock/README.md +++ b/modules/default/clock/README.md @@ -2,4 +2,4 @@ The `clock` module is one of the default modules of the MagicMirror. This module displays the current date and time. The information will be updated realtime. -For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/clock.html). \ No newline at end of file +For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/clock.html). diff --git a/modules/default/compliments/README.md b/modules/default/compliments/README.md index 7825bb02..c746f318 100644 --- a/modules/default/compliments/README.md +++ b/modules/default/compliments/README.md @@ -2,4 +2,4 @@ The `compliments` module is one of the default modules of the MagicMirror. This module displays a random compliment. -For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/compliments.html). \ No newline at end of file +For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/compliments.html). diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index 3cbdcbea..27b047da 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -2,4 +2,4 @@ The `currentweather` module is one of the default modules of the MagicMirror. This module displays the current weather, including the windspeed, the sunset or sunrise time, the temperature and an icon to display the current conditions. -For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/currentweather.html). \ No newline at end of file +For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/currentweather.html). diff --git a/modules/default/helloworld/README.md b/modules/default/helloworld/README.md index aa9f87f3..8ad06f77 100644 --- a/modules/default/helloworld/README.md +++ b/modules/default/helloworld/README.md @@ -1,4 +1,4 @@ # Module: Hello World The `helloworld` module is one of the default modules of the MagicMirror. It is a simple way to display a static text on the mirror. -For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/helloworld.html). \ No newline at end of file +For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/helloworld.html). diff --git a/modules/default/newsfeed/README.md b/modules/default/newsfeed/README.md index 4dc4877b..33690aa6 100644 --- a/modules/default/newsfeed/README.md +++ b/modules/default/newsfeed/README.md @@ -2,4 +2,4 @@ The `newsfeed ` module is one of the default modules of the MagicMirror. This module displays news headlines based on an RSS feed. Scrolling through news headlines happens time-based (````updateInterval````), but can also be controlled by sending news feed specific notifications to the module. -For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/newsfeed.html). \ No newline at end of file +For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/newsfeed.html). diff --git a/modules/default/updatenotification/README.md b/modules/default/updatenotification/README.md index 652f451f..af6305e6 100644 --- a/modules/default/updatenotification/README.md +++ b/modules/default/updatenotification/README.md @@ -2,4 +2,4 @@ The `updatenotification` module is one of the default modules of the MagicMirror. This will display a message whenever a new version of the MagicMirror application is available. -For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/updatenotification.html). \ No newline at end of file +For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/updatenotification.html). diff --git a/modules/default/weather/README.md b/modules/default/weather/README.md index 5b03b141..ebc301f4 100755 --- a/modules/default/weather/README.md +++ b/modules/default/weather/README.md @@ -2,4 +2,4 @@ This module is aimed to be the replacement for the current `currentweather` and `weatherforcast` modules. The module will be configurable to be used as a current weather view, or to show the forecast. This way the module can be used twice to fullfil both purposes. -For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/weather.html). \ No newline at end of file +For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/weather.html). diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index 95762daa..7dfbd16f 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -2,4 +2,4 @@ The `weatherforecast` module is one of the default modules of the MagicMirror. This module displays the weather forecast for the coming week, including an an icon to display the current conditions, the minimum temperature and the maximum temperature. -For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/weatherforecast.html). \ No newline at end of file +For configuration options, please check the [MagicMirror² documentation](https://docs.magicmirror.builders/modules/weatherforecast.html).