mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +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 {
|
||||
this.effectIndex = -1;
|
||||
}
|
||||
} else {
|
||||
this.brightnessSliderValue = 0;
|
||||
}
|
||||
|
||||
this.async(function () {
|
||||
@ -140,9 +142,16 @@ Polymer({
|
||||
},
|
||||
|
||||
computeClassNames: function (stateObj) {
|
||||
return window.hassUtil.attributeClassNames(
|
||||
stateObj, ['brightness', 'rgb_color', 'color_temp', 'white_value',
|
||||
var classes = window.hassUtil.attributeClassNames(
|
||||
stateObj, ['rgb_color', 'color_temp', 'white_value',
|
||||
'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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user