diff --git a/js/beestat/runtime_thermostat.js b/js/beestat/runtime_thermostat.js index 0252d48..3070fe6 100644 --- a/js/beestat/runtime_thermostat.js +++ b/js/beestat/runtime_thermostat.js @@ -107,6 +107,13 @@ beestat.runtime_thermostat.get_data = function(thermostat_id, range) { */ 'data': {} }; + + if (beestat.series[series_code] !== undefined) { + data.metadata.series[series_code].name = beestat.series[series_code].name; + } else { + data.metadata.series[series_code].name = null; + } + durations[series_code] = {'seconds': 0}; }); diff --git a/js/component/chart/runtime_sensor_detail_temperature.js b/js/component/chart/runtime_sensor_detail_temperature.js index 9e46a64..bed3417 100644 --- a/js/component/chart/runtime_sensor_detail_temperature.js +++ b/js/component/chart/runtime_sensor_detail_temperature.js @@ -38,6 +38,12 @@ beestat.component.chart.runtime_sensor_detail_temperature.prototype.get_options_ }; }; +/** + * Get legend values. The series name is used for some other magic so this has + * to be overridden. + * + * @return {function} A function that returns the proper legend name. + */ beestat.component.chart.runtime_sensor_detail_temperature.prototype.get_options_legend_labelFormatter_ = function() { var self = this; return function() { @@ -101,6 +107,25 @@ beestat.component.chart.runtime_sensor_detail_temperature.prototype.get_options_ }); }); + // Indoor/Outdoor Temperature + [ + 'indoor_temperature', + 'outdoor_temperature' + ].forEach(function(series_code) { + if (self.data_.metadata.series[series_code].active === true) { + series.push({ + 'name': series_code, + 'data': self.data_.series[series_code], + 'color': beestat.series[series_code].color, + 'yAxis': 0, + 'type': 'spline', + 'dashStyle': (series_code === 'indoor_temperature') ? 'Solid' : 'ShortDash', + 'lineWidth': (series_code === 'indoor_temperature') ? 2 : 1, + 'visible': false + }); + } + }); + series.push({ 'name': '', 'data': self.data_.series.dummy,