Skip to content
Snippets Groups Projects
Commit c489c68f authored by Paulus Schoutsen's avatar Paulus Schoutsen
Browse files

state-badge no longer sets url(undefined) as background-image

parent bb23f57f
No related branches found
No related tags found
No related merge requests found
""" DO NOT MODIFY. Auto-generated by build_frontend script """ """ DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "78833990f9ec3b3b56f233320ede7f89" VERSION = "52df22ae159b45a14b265b26a6f4ff55"
...@@ -17812,7 +17812,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN ...@@ -17812,7 +17812,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<div horizontal="" layout="" center=""> <div horizontal="" layout="" center="">
<domain-icon id="icon" domain="{{stateObj.domain}}" state="{{stateObj.state}}"> <domain-icon id="icon" domain="{{stateObj.domain}}" state="{{stateObj.state}}">
</domain-icon> </domain-icon>
<div fit="" id="picture" style="{{'background-image: url('+stateObj.attributes.entity_picture+')'}}"></div> <div fit="" id="picture"></div>
</div> </div>
   
</template> </template>
...@@ -17839,6 +17839,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN ...@@ -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 // from http://stackoverflow.com/questions/22894498/philips-hue-convert-xy-from-api-to-hex-or-rgb
xyBriToRgb: function (x, y, bri) { xyBriToRgb: function (x, y, bri) {
z = 1.0 - x - y; z = 1.0 - x - y;
......
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
<domain-icon id="icon" <domain-icon id="icon"
domain="{{stateObj.domain}}" state="{{stateObj.state}}"> domain="{{stateObj.domain}}" state="{{stateObj.state}}">
</domain-icon> </domain-icon>
<div fit id="picture" <div fit id="picture"></div>
style="{{'background-image: url('+stateObj.attributes.entity_picture+')'}}"></div>
</div> </div>
</template> </template>
...@@ -67,6 +66,14 @@ ...@@ -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 // from http://stackoverflow.com/questions/22894498/philips-hue-convert-xy-from-api-to-hex-or-rgb
xyBriToRgb: function (x, y, bri) { xyBriToRgb: function (x, y, bri) {
z = 1.0 - x - y; z = 1.0 - x - y;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment