Color wheel fixes (#706)

* hide overflow properly

* only try to do rgb stuff on init if we have a value

* just to be sure
This commit is contained in:
NovapaX 2017-12-04 02:03:34 +01:00 committed by Paulus Schoutsen
parent 77cc77396b
commit 8dc81b1daa
2 changed files with 9 additions and 4 deletions

View File

@ -317,6 +317,9 @@ class HaColorPicker extends window.hassMixins.EventsMixin(Polymer.Element) {
*/
applyRgbColor(rgb) {
if (!rgb) {
return;
}
// do nothing is we already have the same color
if (this.rgbColor &&
this.rgbColor.r === rgb.r &&

View File

@ -34,8 +34,8 @@
width: 100%;
max-height: 0px;
overflow: visible;
transition: max-height .2s ease-in;
overflow: hidden;
transition: max-height .5s ease-in;
}
.has-effect_list .effect_list,
@ -47,6 +47,7 @@
.has-rgb_color ha-color-picker {
max-height: 500px;
overflow: visible;
--ha-color-picker-wheel-borderwidth: 5;
--ha-color-picker-wheel-bordercolor: white;
--ha-color-picker-wheel-shadow: none;
@ -159,8 +160,9 @@
this.brightnessSliderValue = newVal.attributes.brightness;
this.ctSliderValue = newVal.attributes.color_temp;
this.wvSliderValue = newVal.attributes.white_value;
this.colorPickerColor = this.rgbArrToObj(newVal.attributes.rgb_color);
if (newVal.attributes.rgb_color) {
this.colorPickerColor = this.rgbArrToObj(newVal.attributes.rgb_color);
}
if (newVal.attributes.effect_list) {
this.effectIndex = newVal.attributes.effect_list.indexOf(newVal.attributes.effect);
} else {