From c489c68f0231c67bcf3b940ff8a205db4e9fb8dd Mon Sep 17 00:00:00 2001
From: Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>
Date: Sun, 2 Nov 2014 18:50:16 -0800
Subject: [PATCH] state-badge no longer sets url(undefined) as background-image

---
 homeassistant/components/http/frontend.py             |  2 +-
 .../components/http/www_static/frontend.html          | 10 +++++++++-
 .../http/www_static/polymer/state-badge.html          | 11 +++++++++--
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/homeassistant/components/http/frontend.py b/homeassistant/components/http/frontend.py
index 9edbfa0e0c2..ec1497e48f2 100644
--- a/homeassistant/components/http/frontend.py
+++ b/homeassistant/components/http/frontend.py
@@ -1,2 +1,2 @@
 """ DO NOT MODIFY. Auto-generated by build_frontend script """
-VERSION = "78833990f9ec3b3b56f233320ede7f89"
+VERSION = "52df22ae159b45a14b265b26a6f4ff55"
diff --git a/homeassistant/components/http/www_static/frontend.html b/homeassistant/components/http/www_static/frontend.html
index 29e76e6e629..ccb73c5b245 100644
--- a/homeassistant/components/http/www_static/frontend.html
+++ b/homeassistant/components/http/www_static/frontend.html
@@ -17812,7 +17812,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
     <div horizontal="" layout="" center="">
       <domain-icon id="icon" domain="{{stateObj.domain}}" state="{{stateObj.state}}">
       </domain-icon>
-      <div fit="" id="picture" style="{{'background-image: url('+stateObj.attributes.entity_picture+')'}}"></div>
+      <div fit="" id="picture"></div>
     </div>
 
   </template>
@@ -17839,6 +17839,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
       }
     },
 
+    entityPictureChanged: function(oldVal, newVal) {
+      if(newVal) {
+        this.$.picture.style.backgroundImage = 'url(' + newVal + ')';
+      } else {
+        this.$.picture.style.backgroundImage = null;
+      }
+    },
+
     // from http://stackoverflow.com/questions/22894498/philips-hue-convert-xy-from-api-to-hex-or-rgb
     xyBriToRgb: function (x, y, bri) {
       z = 1.0 - x - y;
diff --git a/homeassistant/components/http/www_static/polymer/state-badge.html b/homeassistant/components/http/www_static/polymer/state-badge.html
index 2f98b566070..3e1e8189d1c 100644
--- a/homeassistant/components/http/www_static/polymer/state-badge.html
+++ b/homeassistant/components/http/www_static/polymer/state-badge.html
@@ -39,8 +39,7 @@
       <domain-icon id="icon"
         domain="{{stateObj.domain}}" state="{{stateObj.state}}">
       </domain-icon>
-      <div fit id="picture"
-        style="{{'background-image: url('+stateObj.attributes.entity_picture+')'}}"></div>
+      <div fit id="picture"></div>
     </div>
 
   </template>
@@ -67,6 +66,14 @@
       }
     },
 
+    entityPictureChanged: function(oldVal, newVal) {
+      if(newVal) {
+        this.$.picture.style.backgroundImage = 'url(' + newVal + ')';
+      } else {
+        this.$.picture.style.backgroundImage = null;
+      }
+    },
+
     // from http://stackoverflow.com/questions/22894498/philips-hue-convert-xy-from-api-to-hex-or-rgb
     xyBriToRgb: function (x, y, bri) {
       z = 1.0 - x - y;
-- 
GitLab