mirror of
https://github.com/beestat/app.git
synced 2025-07-09 03:04:07 -04:00
Fixed #253 - Add comfort profile to Sensor Detail tooltip
This commit is contained in:
parent
f59fee7827
commit
a84417b8d4
@ -165,7 +165,10 @@ beestat.component.chart.runtime_sensor_detail_temperature.prototype.get_options_
|
|||||||
var x = this.x;
|
var x = this.x;
|
||||||
|
|
||||||
var sections = [];
|
var sections = [];
|
||||||
var group = [];
|
var groups = {
|
||||||
|
'mode': [],
|
||||||
|
'data': []
|
||||||
|
};
|
||||||
|
|
||||||
var visible_series = [];
|
var visible_series = [];
|
||||||
self.get_chart().series.forEach(function(series) {
|
self.get_chart().series.forEach(function(series) {
|
||||||
@ -191,6 +194,31 @@ beestat.component.chart.runtime_sensor_detail_temperature.prototype.get_options_
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add some other stuff.
|
||||||
|
[
|
||||||
|
'calendar_event_smartrecovery',
|
||||||
|
'calendar_event_home',
|
||||||
|
'calendar_event_away',
|
||||||
|
'calendar_event_sleep',
|
||||||
|
'calendar_event_smarthome',
|
||||||
|
'calendar_event_smartaway',
|
||||||
|
'calendar_event_hold',
|
||||||
|
'calendar_event_vacation',
|
||||||
|
'calendar_event_quicksave',
|
||||||
|
'calendar_event_other',
|
||||||
|
'calendar_event_custom'
|
||||||
|
].forEach(function(series_code) {
|
||||||
|
if (
|
||||||
|
self.data_.metadata.series[series_code].data[x.valueOf()] !== undefined
|
||||||
|
) {
|
||||||
|
points.push({
|
||||||
|
'series_code': series_code,
|
||||||
|
'value': self.data_.metadata.series[series_code].data[x.valueOf()],
|
||||||
|
'color': beestat.series[series_code].color
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var occupancy = {};
|
var occupancy = {};
|
||||||
self.get_chart().series.forEach(function(series) {
|
self.get_chart().series.forEach(function(series) {
|
||||||
if (series.name.substring(0, 12) === 'temperature_') {
|
if (series.name.substring(0, 12) === 'temperature_') {
|
||||||
@ -208,8 +236,20 @@ beestat.component.chart.runtime_sensor_detail_temperature.prototype.get_options_
|
|||||||
points.forEach(function(point) {
|
points.forEach(function(point) {
|
||||||
var label;
|
var label;
|
||||||
var value;
|
var value;
|
||||||
|
var group;
|
||||||
|
var color;
|
||||||
|
|
||||||
|
if (
|
||||||
|
point.series_code.includes('calendar_event')
|
||||||
|
) {
|
||||||
|
group = 'mode';
|
||||||
|
label = 'Comfort Profile';
|
||||||
|
color = beestat.series[point.series_code].color;
|
||||||
|
value = self.data_.metadata.series.calendar_event_name[x.valueOf()];
|
||||||
|
} else {
|
||||||
|
group = 'data';
|
||||||
label = self.data_.metadata.series[point.series_code].name;
|
label = self.data_.metadata.series[point.series_code].name;
|
||||||
|
color = point.color;
|
||||||
if (point.value === undefined) {
|
if (point.value === undefined) {
|
||||||
value = '-';
|
value = '-';
|
||||||
} else {
|
} else {
|
||||||
@ -224,23 +264,28 @@ beestat.component.chart.runtime_sensor_detail_temperature.prototype.get_options_
|
|||||||
if (occupancy[occupancy_key] === true) {
|
if (occupancy[occupancy_key] === true) {
|
||||||
value += ' ●';
|
value += ' ●';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
group.push({
|
groups[group].push({
|
||||||
'label': label,
|
'label': label,
|
||||||
'value': value,
|
'value': value,
|
||||||
'color': point.color
|
'color': color
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (group.length === 0) {
|
if (
|
||||||
group.push({
|
groups.mode.length === 0 &&
|
||||||
|
groups.data.length === 0
|
||||||
|
) {
|
||||||
|
groups.mode.push({
|
||||||
'label': 'No data',
|
'label': 'No data',
|
||||||
'value': '',
|
'value': '',
|
||||||
'color': beestat.style.color.gray.base
|
'color': beestat.style.color.gray.base
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
sections.push(group);
|
sections.push(groups.mode);
|
||||||
|
sections.push(groups.data);
|
||||||
|
|
||||||
var title = this.x.format('ddd, MMM D @ h:mma');
|
var title = this.x.format('ddd, MMM D @ h:mma');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user