1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00

Fixed #236 - Add indoor/outdoor temperature to Sensor Detail

This commit is contained in:
Jon Ziebell 2020-02-11 21:06:04 -05:00
parent 6b9241d0c7
commit 87cf3f042e
2 changed files with 32 additions and 0 deletions

View File

@ -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};
});

View File

@ -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,