Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always show the brightness slider in more-info #168

Merged
merged 3 commits into from Jan 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/more-infos/more-info-light.html
Expand Up @@ -132,6 +132,8 @@
} else {
this.effectIndex = -1;
}
} else {
this.brightnessSliderValue = 0;
}

this.async(function () {
Expand All @@ -140,9 +142,16 @@
},

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) {
Expand Down