diff --git a/homeassistant/components/frontend/www_static/polymer/components/state-history-chart-timeline.html b/homeassistant/components/frontend/www_static/polymer/components/state-history-chart-timeline.html index 3d35718c974..8026cc6e8e5 100644 --- a/homeassistant/components/frontend/www_static/polymer/components/state-history-chart-timeline.html +++ b/homeassistant/components/frontend/www_static/polymer/components/state-history-chart-timeline.html @@ -36,16 +36,16 @@ } var root = Polymer.dom(this); - var data = this.data; + var stateHistory = this.data; while (root.lastChild) { root.removeChild(root.lastChild); } - if (data.length === 0) { + if (!stateHistory || stateHistory.length === 0) { return; } - + // debugger; var chart = new google.visualization.Timeline(this); var dataTable = new google.visualization.DataTable(); @@ -60,13 +60,13 @@ }; // people can pass in history of 1 entityId or a collection. - var stateHistory; - if (_.isArray(data[0])) { - stateHistory = data; - } else { - stateHistory = [data]; - isSingleDevice = true; - } + // var stateHistory; + // if (_.isArray(data[0])) { + // stateHistory = data; + // } else { + // stateHistory = [data]; + // isSingleDevice = true; + // } var numTimelines = 0; // stateHistory is a list of lists of sorted state objects diff --git a/homeassistant/components/frontend/www_static/polymer/components/state-history-charts.html b/homeassistant/components/frontend/www_static/polymer/components/state-history-charts.html index 4f833ac8a1b..cfcf2adaaca 100644 --- a/homeassistant/components/frontend/www_static/polymer/components/state-history-charts.html +++ b/homeassistant/components/frontend/www_static/polymer/components/state-history-charts.html @@ -79,13 +79,17 @@ }, computeIsSingleDevice: function(stateHistory) { - return stateHistory.length == 1; + return stateHistory && stateHistory.length == 1; }, computeGroupedStateHistory: function(stateHistory) { var lineChartDevices = {}; var timelineDevices = []; + if (!stateHistory) { + return {line: unitStates, timeline: timelineDevices}; + } + stateHistory.forEach(function(stateInfo) { if (!stateInfo || stateInfo.length === 0) { return; diff --git a/homeassistant/components/frontend/www_static/polymer/dialogs/more-info-dialog.html b/homeassistant/components/frontend/www_static/polymer/dialogs/more-info-dialog.html index c73180b05b6..88116365555 100644 --- a/homeassistant/components/frontend/www_static/polymer/dialogs/more-info-dialog.html +++ b/homeassistant/components/frontend/www_static/polymer/dialogs/more-info-dialog.html @@ -20,8 +20,8 @@