mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 21:06:34 +00:00
Climate: add supported_features (#642)
* Honor new supported_features * Re-add legacy classes * Move current temperature / humidity to attribute-based
This commit is contained in:
parent
7d20d8fe71
commit
640e6eb1ef
@ -35,11 +35,12 @@
|
|||||||
|
|
||||||
.has-away_mode .container-away_mode,
|
.has-away_mode .container-away_mode,
|
||||||
.has-aux_heat .container-aux_heat,
|
.has-aux_heat .container-aux_heat,
|
||||||
.has-temperature .container-temperature,
|
.has-target_temperature .container-temperature,
|
||||||
.has-humidity .container-humidity,
|
.has-target_humidity .container-humidity,
|
||||||
.has-operation_list .container-operation_list,
|
.has-operation_mode .container-operation_list,
|
||||||
.has-fan_list .container-fan_list,
|
.has-fan_mode .container-fan_list,
|
||||||
.has-swing_list .container-swing_list {
|
.has-swing_list .container-swing_list,
|
||||||
|
.has-swing_mode .container-swing_list {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,10 +279,30 @@ class MoreInfoClimate extends window.hassMixins.EventsMixin(Polymer.Element) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
computeClassNames(stateObj) {
|
computeClassNames(stateObj) {
|
||||||
return 'more-info-climate ' + window.hassUtil.attributeClassNames(stateObj, [
|
const featureClassNames = {
|
||||||
'away_mode', 'aux_heat', 'temperature', 'humidity', 'operation_list',
|
1: 'has-target_temperature',
|
||||||
'fan_list', 'swing_list',
|
2: 'has-target_temperature_high',
|
||||||
]);
|
4: 'has-target_temperature_low',
|
||||||
|
8: 'has-target_humidity',
|
||||||
|
16: 'has-target_humidity_high',
|
||||||
|
32: 'has-target_humidity_low',
|
||||||
|
64: 'has-fan_mode',
|
||||||
|
128: 'has-operation_mode',
|
||||||
|
256: 'has-hold_mode',
|
||||||
|
512: 'has-swing_mode',
|
||||||
|
1024: 'has-away_mode',
|
||||||
|
2048: 'has-aux_heat',
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var classes = [
|
||||||
|
window.hassUtil.attributeClassNames(stateObj, ['current_temperature', 'current_humidity']),
|
||||||
|
window.hassUtil.featureClassNames(stateObj, featureClassNames),
|
||||||
|
];
|
||||||
|
|
||||||
|
classes.push('more-info-climate');
|
||||||
|
|
||||||
|
return classes.join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
targetTemperatureChanged(ev) {
|
targetTemperatureChanged(ev) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user