Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hideOnNoWarnings config option #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MMM-UKMOWeatherWarnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Module.register("MMM-UKMOWeatherWarnings", {
useTestData: false,
testUrl: null,
backgroundMode: false,
hideOnNoWarnings: false,
delta: 0, //minutes
},

Expand Down
2 changes: 1 addition & 1 deletion MMM-UKMOWeatherWarnings.njk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% if warnings %}
{% if not config.backgroundMode %}
{% if not config.backgroundMode and (not config.hideOnNoWarnings or warnings.items) %}
<div class="small">{{warnings.title}}</div>
{% if warnings.items %}
<table class="small">
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var config = {
| `useTestData` | *Optional* Whether to use test data instaed of the live feed <br><br>**Type:** `boolean` <br>Default `false`
| `testUrl` | *Optional* URL of the test data file <br><br>**Type:** `string` <br>e.g. `http://localhost:8080/modules/MMM-UKMOWeatherWarnings/public/warns.json`
| `backgroundMode` | *Optional* Whether to run in background mode, only sending notifications <br><br>**Type:** `boolean` <br>Default `false`
| `hideOnNoWarnings` | *Optional* Whether to hide the module if there are no warnings found <br><br>**Type:** `boolean` <br>Default `false`
| `delta` | *Optional* Look ahead delta for current warnings <br><br>**Type:** `int`(minutes) <br>0

#### Regions
Expand Down