From f2b7308061b215a178f644ab47f7f797b2b1a4d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 25 Jul 2018 20:30:46 +0200 Subject: [PATCH] Better hide if empty handling (#3) * Added better hanling of empty state * version bump --- VERSION | 2 +- state-attribute-element.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 6812f81..05b19b1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.3 \ No newline at end of file +0.0.4 \ No newline at end of file diff --git a/state-attribute-element.js b/state-attribute-element.js index 8dcd21c..c4a8584 100644 --- a/state-attribute-element.js +++ b/state-attribute-element.js @@ -6,7 +6,7 @@ class StateAttributeElement extends HTMLElement { const attr = this.config.attribute; const state = hass.states[entityId].attributes[attr]; const card = document.createElement('state-attribute-element'); - if (state != null) { + if (state.length != 0) { if (prefix_string) { this.innerHTML = prefix_string + state; } else {