From bded3a278b5988783b732f14bed4888ef69c7846 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Fri, 24 Jun 2022 12:41:14 -0400 Subject: [PATCH] Updated a few things to support merged thermostats. --- api/runtime_thermostat_summary.php | 3 +-- js/component/card/air_quality_detail.js | 2 +- js/component/card/runtime_sensor_detail.js | 2 +- js/component/card/runtime_thermostat_detail.js | 2 +- js/component/card/runtime_thermostat_summary.js | 2 +- js/component/card/voc_summary.js | 2 +- js/component/modal/download_data.js | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/api/runtime_thermostat_summary.php b/api/runtime_thermostat_summary.php index 64ee723..6892e4e 100755 --- a/api/runtime_thermostat_summary.php +++ b/api/runtime_thermostat_summary.php @@ -10,8 +10,7 @@ class runtime_thermostat_summary extends cora\crud { public static $exposed = [ 'private' => [ 'read_id', - 'sync', - 'populate_backwards' + 'sync' ], 'public' => [] ]; diff --git a/js/component/card/air_quality_detail.js b/js/component/card/air_quality_detail.js index 5898ee7..1b49b85 100644 --- a/js/component/card/air_quality_detail.js +++ b/js/component/card/air_quality_detail.js @@ -116,7 +116,7 @@ beestat.component.card.air_quality_detail.prototype.decorate_contents_ = functio // Don't go before there's data. required_begin = moment.max( required_begin, - moment.utc(thermostat.first_connected) + moment.utc(thermostat.data_begin) ); // Don't go after now. diff --git a/js/component/card/runtime_sensor_detail.js b/js/component/card/runtime_sensor_detail.js index 11ffc90..a30f677 100644 --- a/js/component/card/runtime_sensor_detail.js +++ b/js/component/card/runtime_sensor_detail.js @@ -116,7 +116,7 @@ beestat.component.card.runtime_sensor_detail.prototype.decorate_contents_ = func // Don't go before there's data. required_begin = moment.max( required_begin, - moment.utc(thermostat.first_connected) + moment.utc(thermostat.data_begin) ); // Don't go after now. diff --git a/js/component/card/runtime_thermostat_detail.js b/js/component/card/runtime_thermostat_detail.js index 8804bf1..606e124 100644 --- a/js/component/card/runtime_thermostat_detail.js +++ b/js/component/card/runtime_thermostat_detail.js @@ -135,7 +135,7 @@ beestat.component.card.runtime_thermostat_detail.prototype.decorate_contents_ = // Don't go before there's data. required_begin = moment.max( required_begin, - moment.utc(thermostat.first_connected) + moment.utc(thermostat.data_begin) ); // Don't go after now. diff --git a/js/component/card/runtime_thermostat_summary.js b/js/component/card/runtime_thermostat_summary.js index 8f301ad..1c4d7b7 100755 --- a/js/component/card/runtime_thermostat_summary.js +++ b/js/component/card/runtime_thermostat_summary.js @@ -182,7 +182,7 @@ beestat.component.card.runtime_thermostat_summary.prototype.get_data_ = function var begin_m; if (beestat.setting('runtime_thermostat_summary_time_period') === 'all') { begin_m = moment( - beestat.cache.thermostat[this.thermostat_id_].first_connected + beestat.cache.thermostat[this.thermostat_id_].data_begin ); } else { var time_periods = [ diff --git a/js/component/card/voc_summary.js b/js/component/card/voc_summary.js index c66508a..c4fb565 100644 --- a/js/component/card/voc_summary.js +++ b/js/component/card/voc_summary.js @@ -82,7 +82,7 @@ beestat.component.card.voc_summary.prototype.decorate_contents_ = function(paren // Don't go before there's data. required_begin = moment.max( required_begin, - moment.utc(thermostat.first_connected) + moment.utc(thermostat.data_begin) ); // Don't go after now. diff --git a/js/component/modal/download_data.js b/js/component/modal/download_data.js index 13e38b5..bfcf6ec 100644 --- a/js/component/modal/download_data.js +++ b/js/component/modal/download_data.js @@ -175,7 +175,7 @@ beestat.component.modal.download_data.prototype.decorate_presets_ = function(par }, { 'label': 'All Time', - 'range_begin': moment.max(moment(thermostat.first_connected), now.clone().subtract(1, 'year')), + 'range_begin': moment.max(moment(thermostat.data_begin), now.clone().subtract(1, 'year')), 'range_end': now.clone(), 'button': new beestat.component.button() }