From a524a920035147244e7575931190e65500cfd20a Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Sun, 29 Jan 2023 07:04:10 -0500 Subject: [PATCH] Minor changes for PHP8 --- api/runtime_thermostat_summary.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/runtime_thermostat_summary.php b/api/runtime_thermostat_summary.php index 6b31d11..7018742 100755 --- a/api/runtime_thermostat_summary.php +++ b/api/runtime_thermostat_summary.php @@ -139,10 +139,14 @@ class runtime_thermostat_summary extends cora\crud { public function populate_backwards($thermostat_id) { $thermostat = $this->api('thermostat', 'get', $thermostat_id); + // If there's no data do nothing. + if ($thermostat['data_begin'] === null) { + return; + } + $query = ' select min(`date`) `min_date` - #"2020-09-25" `min_date` from `runtime_thermostat_summary` where @@ -163,7 +167,7 @@ class runtime_thermostat_summary extends cora\crud { $populate_begin = date('Y-m-d', $populate_begin); $populate_end = date('Y-m-d', $populate_end); - return $this->populate($thermostat_id, $populate_begin, $populate_end); + $this->populate($thermostat_id, $populate_begin, $populate_end); } /**