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

This commit is contained in:
Paulus Schoutsen 2014-11-02 18:50:16 -08:00
parent bb23f57f96
commit c489c68f02
3 changed files with 19 additions and 4 deletions

View File

@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "78833990f9ec3b3b56f233320ede7f89"
VERSION = "52df22ae159b45a14b265b26a6f4ff55"

View File

@ -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;

View File

@ -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;