From 5414f3b0cc9d9d0f8c4e17eaa7d0b77cda672870 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Mon, 28 Aug 2023 06:46:23 -0400 Subject: [PATCH] Fixed bug where heating and cooling degree days need default value --- api/runtime_thermostat_summary.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/runtime_thermostat_summary.php b/api/runtime_thermostat_summary.php index 3036595..303325d 100755 --- a/api/runtime_thermostat_summary.php +++ b/api/runtime_thermostat_summary.php @@ -301,6 +301,9 @@ class runtime_thermostat_summary extends cora\crud { // Write to the database. foreach($data as $date => &$row) { // $row['sum_degree_days'] = (array_mean($row['sum_degree_days']) / 10) - $degree_days_base_temperature; + $row['sum_heating_degree_days'] = 0; + $row['sum_cooling_degree_days'] = 0; + $row['avg_outdoor_temperature'] = round(array_sum($row['avg_outdoor_temperature']) / count($row['avg_outdoor_temperature'])); $row['avg_outdoor_humidity'] = round(array_sum($row['avg_outdoor_humidity']) / count($row['avg_outdoor_humidity'])); $row['avg_indoor_temperature'] = round(array_sum($row['avg_indoor_temperature']) / count($row['avg_indoor_temperature']));