@@ -17952,20 +18005,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
stateChanged: function(oldVal, newVal) {
this.stateUnknown = newVal == null;
this.toggleChecked = newVal == "on"
-
- var state = this.stateObj;
-
- // for domain light, set color of icon to light color if available
- if(state.domain == "light" && newVal == "on" &&
- state.attributes.brightness && state.attributes.xy_color) {
-
- var rgb = this.xyBriToRgb(state.attributes.xy_color[0],
- state.attributes.xy_color[1],
- state.attributes.brightness);
- this.$.badge.style.color = "rgb(" + rgb.map(Math.floor).join(",") + ")";
- } else {
- this.$.badge.style.color = null;
- }
},
turn_on: function() {
@@ -17998,27 +18037,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
},
- // 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;
- Y = bri / 255.0; // Brightness of lamp
- X = (Y / y) * x;
- Z = (Y / y) * z;
- r = X * 1.612 - Y * 0.203 - Z * 0.302;
- g = -X * 0.509 + Y * 1.412 + Z * 0.066;
- b = X * 0.026 - Y * 0.072 + Z * 0.962;
- r = r <= 0.0031308 ? 12.92 * r : (1.0 + 0.055) * Math.pow(r, (1.0 / 2.4)) - 0.055;
- g = g <= 0.0031308 ? 12.92 * g : (1.0 + 0.055) * Math.pow(g, (1.0 / 2.4)) - 0.055;
- b = b <= 0.0031308 ? 12.92 * b : (1.0 + 0.055) * Math.pow(b, (1.0 / 2.4)) - 0.055;
- maxValue = Math.max(r,g,b);
- r /= maxValue;
- g /= maxValue;
- b /= maxValue;
- r = r * 255; if (r < 0) { r = 255 };
- g = g * 255; if (g < 0) { g = 255 };
- b = b * 255; if (b < 0) { b = 255 };
- return [r, g, b]
- }
});
@@ -18198,7 +18216,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
handleRefreshClick: function() {
- this.api.fetchStates();
+ this.api.fetchAll();
},
handleEventClick: function() {
@@ -19977,11 +19995,55 @@ core-item {
diff --git a/homeassistant/components/http/www_static/polymer/state-card.html b/homeassistant/components/http/www_static/polymer/state-card.html
index 7296840b466..de28e762da0 100755
--- a/homeassistant/components/http/www_static/polymer/state-card.html
+++ b/homeassistant/components/http/www_static/polymer/state-card.html
@@ -27,19 +27,12 @@
state-badge {
float: left;
cursor: pointer;
- transition: background-color .2s ease-in-out, color .5s ease-in-out;
}
state-badge:hover {
background-color: #039be5;
}
- /* Color the icon if light or sun is on */
- state-badge[data-domain=light][data-state=on],
- state-badge[data-domain=sun][data-state=above_horizon] {
- color: #fff176;
- }
-
.name, .state.text {
text-transform: capitalize;
font-weight: 300;
@@ -79,10 +72,7 @@
@@ -158,20 +148,6 @@
stateChanged: function(oldVal, newVal) {
this.stateUnknown = newVal == null;
this.toggleChecked = newVal == "on"
-
- var state = this.stateObj;
-
- // for domain light, set color of icon to light color if available
- if(state.domain == "light" && newVal == "on" &&
- state.attributes.brightness && state.attributes.xy_color) {
-
- var rgb = this.xyBriToRgb(state.attributes.xy_color[0],
- state.attributes.xy_color[1],
- state.attributes.brightness);
- this.$.badge.style.color = "rgb(" + rgb.map(Math.floor).join(",") + ")";
- } else {
- this.$.badge.style.color = null;
- }
},
turn_on: function() {
@@ -204,27 +180,6 @@
}
},
- // 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;
- Y = bri / 255.0; // Brightness of lamp
- X = (Y / y) * x;
- Z = (Y / y) * z;
- r = X * 1.612 - Y * 0.203 - Z * 0.302;
- g = -X * 0.509 + Y * 1.412 + Z * 0.066;
- b = X * 0.026 - Y * 0.072 + Z * 0.962;
- r = r <= 0.0031308 ? 12.92 * r : (1.0 + 0.055) * Math.pow(r, (1.0 / 2.4)) - 0.055;
- g = g <= 0.0031308 ? 12.92 * g : (1.0 + 0.055) * Math.pow(g, (1.0 / 2.4)) - 0.055;
- b = b <= 0.0031308 ? 12.92 * b : (1.0 + 0.055) * Math.pow(b, (1.0 / 2.4)) - 0.055;
- maxValue = Math.max(r,g,b);
- r /= maxValue;
- g /= maxValue;
- b /= maxValue;
- r = r * 255; if (r < 0) { r = 255 };
- g = g * 255; if (g < 0) { g = 255 };
- b = b * 255; if (b < 0) { b = 255 };
- return [r, g, b]
- }
});