mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Always show the brightness slider in more-info (#168)
* Always show the brightness slider in more-info Always show the brightness slider in more-info if it is supported. Even when the light is currently off. * Lint fix * Set brightness to 0 when light is off
This commit is contained in:
parent
57071f7250
commit
029ed86395
@ -132,6 +132,8 @@ Polymer({
|
|||||||
} else {
|
} else {
|
||||||
this.effectIndex = -1;
|
this.effectIndex = -1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.brightnessSliderValue = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.async(function () {
|
this.async(function () {
|
||||||
@ -140,9 +142,16 @@ Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
computeClassNames: function (stateObj) {
|
computeClassNames: function (stateObj) {
|
||||||
return window.hassUtil.attributeClassNames(
|
var classes = window.hassUtil.attributeClassNames(
|
||||||
stateObj, ['brightness', 'rgb_color', 'color_temp', 'white_value',
|
stateObj, ['rgb_color', 'color_temp', 'white_value',
|
||||||
'effect_list']);
|
'effect_list']);
|
||||||
|
var BRIGHTNESS_SUPPORTED = 1;
|
||||||
|
// If brightness is supported - show the slider even if the attribute is
|
||||||
|
// missing (because the light is off).
|
||||||
|
if (stateObj && (stateObj.attributes.supported_features & BRIGHTNESS_SUPPORTED)) {
|
||||||
|
classes += ' has-brightness';
|
||||||
|
}
|
||||||
|
return classes;
|
||||||
},
|
},
|
||||||
|
|
||||||
effectChanged: function (effectIndex) {
|
effectChanged: function (effectIndex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user