Skip to content

Commit

Permalink
fixed onlyOnRain feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Litzenburger committed Aug 19, 2021
1 parent e3350a5 commit 89f67ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion MMM-RAIN-MAP.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Module.register("MMM-RAIN-MAP", {
},

notificationReceived(notificationIdentifier: string, payload: any) {
if(this.config.displayOnlyOnRain){
if (this.config.displayOnlyOnRain) {
if (notificationIdentifier === "OPENWEATHER_FORECAST_WEATHER_UPDATE") {
const currentCondition = payload.current?.weather[0]?.icon;
this.handleCurrentWeatherCondition(currentCondition);
Expand Down Expand Up @@ -260,16 +260,16 @@ Module.register("MMM-RAIN-MAP", {
"snow",
];
if (currentCondition && rainConditions.findIndex((condition) => currentCondition.includes(condition)) >= 0) {
if (!this.runtimeData.animationTimer) {
this.show();
this.play();
}
} else {
if (this.runtimeData.animationTimer) {
this.hide();
clearTimeout(this.runtimeData.animationTimer);
this.runtimeData.animationTimer = null;
}
} else {
if (!this.runtimeData.animationTimer) {
this.show();
this.play();
}
}
},
});

0 comments on commit 89f67ff

Please sign in to comment.