mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 21:06:34 +00:00
updating cover more-info to use supported features for configuration (#274)
* updating cover more-info to use supported features * changing per best practices * removing debugging text, whoops * allowing for visibility of tilt position even if control is disallowed * more changes * still more changes
This commit is contained in:
parent
aceab5246c
commit
07364bed53
27
src/more-infos/more-info-cover.html
Normal file → Executable file
27
src/more-infos/more-info-cover.html
Normal file → Executable file
@ -10,12 +10,17 @@
|
||||
<template>
|
||||
<style is="custom-style" include="iron-flex"></style>
|
||||
<style>
|
||||
.current_position, .current_tilt_position {
|
||||
.current_position, .tilt {
|
||||
max-height: 0px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.has-current_position .current_position,
|
||||
.has-current_tilt_position .current_tilt_position {
|
||||
.has-open_tilt .tilt,
|
||||
.has-close_tilt .tilt,
|
||||
.has-stop_tilt .tilt,
|
||||
.has-set_tilt_position .tilt,
|
||||
.has-current_tilt_position .tilt
|
||||
{
|
||||
max-height: 90px;
|
||||
}
|
||||
|
||||
@ -23,7 +28,6 @@
|
||||
visibility: hidden !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class$='[[computeClassNames(stateObj)]]'>
|
||||
|
||||
<div class='current_position'>
|
||||
@ -36,7 +40,7 @@
|
||||
on-change='coverPositionSliderChanged'></paper-slider>
|
||||
</div>
|
||||
|
||||
<div class='current_tilt_position'>
|
||||
<div class='tilt'>
|
||||
<div>Tilt position</div>
|
||||
<paper-icon-button icon="mdi:arrow-top-right"
|
||||
on-tap='onOpenTiltTap' title='Open tilt'
|
||||
@ -87,6 +91,7 @@ Polymer({
|
||||
coverTiltPositionSliderValue: {
|
||||
type: Number,
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
computeEntityObj: function (hass, stateObj) {
|
||||
@ -98,9 +103,19 @@ Polymer({
|
||||
this.coverTiltPositionSliderValue = newVal.attributes.current_tilt_position;
|
||||
},
|
||||
|
||||
featureClassNames: {
|
||||
16: 'has-open_tilt',
|
||||
32: 'has-close_tilt',
|
||||
64: 'has-stop_tilt',
|
||||
128: 'has-set_tilt_position',
|
||||
},
|
||||
|
||||
computeClassNames: function (stateObj) {
|
||||
return window.hassUtil.attributeClassNames(
|
||||
stateObj, ['current_position', 'current_tilt_position']);
|
||||
var classes = [
|
||||
window.hassUtil.attributeClassNames(stateObj, ['current_position', 'current_tilt_position']),
|
||||
window.hassUtil.featureClassNames(stateObj, this.featureClassNames),
|
||||
];
|
||||
return classes.join(' ');
|
||||
},
|
||||
|
||||
coverPositionSliderChanged: function (ev) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user