From 12de7d4e444422930b6367c3e6a23da103d52276 Mon Sep 17 00:00:00 2001 From: Gerard Martin <344915+gerjomarty@users.noreply.github.com> Date: Tue, 16 Jun 2020 22:30:53 +0100 Subject: [PATCH] Added hideOnNoWarnings config option When set to true, it will hide the module from view unless there are active warnings to show. Defaults to false. --- MMM-UKMOWeatherWarnings.js | 1 + MMM-UKMOWeatherWarnings.njk | 2 +- README.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MMM-UKMOWeatherWarnings.js b/MMM-UKMOWeatherWarnings.js index a2afdfa..2f82f05 100644 --- a/MMM-UKMOWeatherWarnings.js +++ b/MMM-UKMOWeatherWarnings.js @@ -24,6 +24,7 @@ Module.register("MMM-UKMOWeatherWarnings", { useTestData: false, testUrl: null, backgroundMode: false, + hideOnNoWarnings: false, delta: 0, //minutes }, diff --git a/MMM-UKMOWeatherWarnings.njk b/MMM-UKMOWeatherWarnings.njk index 5d628f7..51b569a 100644 --- a/MMM-UKMOWeatherWarnings.njk +++ b/MMM-UKMOWeatherWarnings.njk @@ -1,5 +1,5 @@ {% if warnings %} - {% if not config.backgroundMode %} + {% if not config.backgroundMode and (not config.hideOnNoWarnings or warnings.items) %}