From 3bfe2f1a6b746fda8c99ea55b18c9bb9634eadc8 Mon Sep 17 00:00:00 2001 From: Josh Willox <39120423+jcwillox@users.noreply.github.com> Date: Sun, 5 Jul 2020 21:46:54 +1000 Subject: [PATCH] Ignore unavailable state for secondary-info --- src/secondary-info.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/secondary-info.js b/src/secondary-info.js index f93f4cf2..e12043a1 100644 --- a/src/secondary-info.js +++ b/src/secondary-info.js @@ -93,8 +93,10 @@ class SecondaryInfo extends HTMLElement { ? state.attributes[template.attribute] : state.state; - this._getElement().innerHTML = `${template.prefix || - ""}${state}${template.postfix || ""}`; + if (state) { + this._getElement().innerHTML = `${template.prefix || + ""}${state}${template.postfix || ""}`; + } } }