Remove last pieces of ES6

This commit is contained in:
Paulus Schoutsen 2016-07-19 02:36:11 -07:00
parent 9239a56958
commit bb61c33a4b
5 changed files with 27 additions and 23 deletions

View File

@ -6,8 +6,9 @@
function range(start, end) {
var result = [];
var i;
for (let i = start; i < end; i++) {
for (i = start; i < end; i++) {
result.push(i);
}
@ -151,14 +152,15 @@
// We differentiate between thermostats that have a target temperature
// range versus ones that have just a target temperature
hasTargetRange = states.reduce(
(cum, cur) => cum || cur.attributes.target_temp_high !== cur.attributes.target_temp_low,
false);
function (cum, cur) {
return cum || cur.attributes.target_temp_high !== cur.attributes.target_temp_low;
}, false);
dataTable.addColumn('number', `${name} current temperature`);
dataTable.addColumn('number', name + ' current temperature');
if (hasTargetRange) {
dataTable.addColumn('number', `${name} target temperature high`);
dataTable.addColumn('number', `${name} target temperature low`);
dataTable.addColumn('number', name + ' target temperature high');
dataTable.addColumn('number', name + ' target temperature low');
noInterpolations = [false, true, true];
@ -169,7 +171,7 @@
pushData([state.lastUpdatedAsDate, curTemp, targetHigh, targetLow], noInterpolations);
};
} else {
dataTable.addColumn('number', `${name} target temperature`);
dataTable.addColumn('number', name + ' target temperature');
noInterpolations = [false, true];

View File

@ -108,7 +108,7 @@ Polymer({
}
stateWithUnit = stateInfo.find(
(state) => 'unit_of_measurement' in state.attributes);
function (state) { return 'unit_of_measurement' in state.attributes; });
unit = stateWithUnit ?
stateWithUnit.attributes.unit_of_measurement : false;

View File

@ -13,7 +13,7 @@
<link rel='import' href='./layouts/home-assistant-main.html'>
<link rel='import' href='./resources/home-assistant-style.html'>
<!-- to support panels -->
<link rel="import" href="../layouts/partial-base.html">
<link rel="import" href="./layouts/partial-base.html">
<dom-module id='home-assistant'>
<template>

View File

@ -42,18 +42,20 @@ Polymer({
states: {
type: Array,
bindNuclear: hass => [
hass.moreInfoGetters.currentEntity,
hass.entityGetters.entityMap,
(currentEntity, entities) => {
// weird bug??
if (!currentEntity) {
return [];
}
return currentEntity.attributes.entity_id.map(
entities.get.bind(entities));
},
],
bindNuclear: function (hass) {
return [
hass.moreInfoGetters.currentEntity,
hass.entityGetters.entityMap,
function (currentEntity, entities) {
// weird bug??
if (!currentEntity) {
return [];
}
return currentEntity.attributes.entity_id.map(
entities.get.bind(entities));
},
];
},
},
},

View File

@ -217,7 +217,7 @@ Polymer({
if (temperature === this.stateObj.attributes.temperature) return;
this.callServiceHelper('set_temperature', { temperature });
this.callServiceHelper('set_temperature', { temperature: temperature });
},
targetHumiditySliderChanged: function (ev) {
@ -225,7 +225,7 @@ Polymer({
if (humidity === this.stateObj.attributes.humidity) return;
this.callServiceHelper('set_humidity', { humidity });
this.callServiceHelper('set_humidity', { humidity: humidity });
},
awayToggleChanged: function (ev) {