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

View File

@ -108,7 +108,7 @@ Polymer({
} }
stateWithUnit = stateInfo.find( stateWithUnit = stateInfo.find(
(state) => 'unit_of_measurement' in state.attributes); function (state) { return 'unit_of_measurement' in state.attributes; });
unit = stateWithUnit ? unit = stateWithUnit ?
stateWithUnit.attributes.unit_of_measurement : false; 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='./layouts/home-assistant-main.html'>
<link rel='import' href='./resources/home-assistant-style.html'> <link rel='import' href='./resources/home-assistant-style.html'>
<!-- to support panels --> <!-- to support panels -->
<link rel="import" href="../layouts/partial-base.html"> <link rel="import" href="./layouts/partial-base.html">
<dom-module id='home-assistant'> <dom-module id='home-assistant'>
<template> <template>

View File

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

View File

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