diff --git a/MMM-HomeAssistantDisplay.js b/MMM-HomeAssistantDisplay.js index 99ffe49..ba53090 100755 --- a/MMM-HomeAssistantDisplay.js +++ b/MMM-HomeAssistantDisplay.js @@ -52,6 +52,13 @@ Module.register("MMM-HomeAssistantDisplay", { entity: section.triggerEntities[entity] }); } + // Set up a timer to trigger re-rendering outside of any entity state update + if (section.refreshTimer) { + setInterval(()=> { + this.renderTemplates("timeout"); + this.updateDom(); + }, section.refreshTimer * 1000); + } } } this.renderTemplates("foo"); diff --git a/README.md b/README.md index 890363e..0c208c1 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ Templates allow you to output virtually any HTML you want to in the contents of | triggerEntities | The array of entities to watch for state changes to determine if this sections displayTemplate should be re-rendered. | | displayTemplate | The template to send to Home Assistant to render. The results of the render will be displayed as the contents of this section in the module. | | class | The CSS class name to add to the `