diff --git a/api/profile.php b/api/profile.php index 33b31f5..1d62478 100644 --- a/api/profile.php +++ b/api/profile.php @@ -936,7 +936,9 @@ class profile extends cora\crud { 'heat_1' => null, 'heat_2' => null, 'cool_1' => null, - 'cool_2' => null + 'cool_2' => null, + 'auxiliary_heat_1' => null, + 'auxiliary_heat_2' => null ], 'balance_point' => [ 'heat_1' => null, @@ -1043,6 +1045,12 @@ class profile extends cora\crud { if($profile['runtime']['heat_2'] > 0) { $profile['runtime_per_degree_day']['heat_2'] = round($profile['runtime']['heat_2'] / $profile['degree_days']['heat'], 2); } + if($profile['runtime']['auxiliary_heat_1'] > 0) { + $profile['runtime_per_degree_day']['auxiliary_heat_1'] = round($profile['runtime']['auxiliary_heat_1'] / $profile['degree_days']['heat'], 2); + } + if($profile['runtime']['auxiliary_heat_2'] > 0) { + $profile['runtime_per_degree_day']['auxiliary_heat_2'] = round($profile['runtime']['auxiliary_heat_2'] / $profile['degree_days']['heat'], 2); + } } } diff --git a/api/thermostat.php b/api/thermostat.php index da716a9..88d31c7 100644 --- a/api/thermostat.php +++ b/api/thermostat.php @@ -418,6 +418,8 @@ class thermostat extends cora\crud { 'runtime_per_degree_day' => [ 'heat_1', 'heat_2', + 'auxiliary_heat_1', + 'auxiliary_heat_2', 'cool_1', 'cool_2' ], @@ -447,6 +449,8 @@ class thermostat extends cora\crud { $intervals['runtime_per_degree_day'] = [ 'heat_1' => 1, 'heat_2' => 1, + 'auxiliary_heat_1' => 1, + 'auxiliary_heat_2' => 1, 'cool_1' => 1, 'cool_2' => 1 ]; diff --git a/js/component/metric/runtime_per_degree_day/auxiliary_heat_1.js b/js/component/metric/runtime_per_degree_day/auxiliary_heat_1.js new file mode 100644 index 0000000..8e67b29 --- /dev/null +++ b/js/component/metric/runtime_per_degree_day/auxiliary_heat_1.js @@ -0,0 +1,22 @@ +/** + * Runtime / HDD for Auxiliary Heat Stage 1 + * + * @param {number} thermostat_id The thermostat ID. + */ +beestat.component.metric.runtime_per_degree_day.auxiliary_heat_1 = function(thermostat_id) { + this.thermostat_id_ = thermostat_id; + + beestat.component.metric.runtime_per_degree_day.apply(this, arguments); +}; +beestat.extend(beestat.component.metric.runtime_per_degree_day.auxiliary_heat_1, beestat.component.metric.runtime_per_degree_day); + +beestat.component.metric.runtime_per_degree_day.auxiliary_heat_1.prototype.child_metric_name_ = 'auxiliary_heat_1'; + +/** + * Get the icon of this metric. + * + * @return {string} The icon of this metric. + */ +beestat.component.metric.runtime_per_degree_day.auxiliary_heat_1.prototype.get_icon_ = function() { + return 'fire'; +}; diff --git a/js/component/metric/runtime_per_degree_day/auxiliary_heat_2.js b/js/component/metric/runtime_per_degree_day/auxiliary_heat_2.js new file mode 100644 index 0000000..79510c8 --- /dev/null +++ b/js/component/metric/runtime_per_degree_day/auxiliary_heat_2.js @@ -0,0 +1,22 @@ +/** + * Runtime / HDD for Auxiliary Heat Stage 2 + * + * @param {number} thermostat_id The thermostat ID. + */ +beestat.component.metric.runtime_per_degree_day.auxiliary_heat_2 = function(thermostat_id) { + this.thermostat_id_ = thermostat_id; + + beestat.component.metric.runtime_per_degree_day.apply(this, arguments); +}; +beestat.extend(beestat.component.metric.runtime_per_degree_day.auxiliary_heat_2, beestat.component.metric.runtime_per_degree_day); + +beestat.component.metric.runtime_per_degree_day.auxiliary_heat_2.prototype.child_metric_name_ = 'auxiliary_heat_2'; + +/** + * Get the icon of this metric. + * + * @return {string} The icon of this metric. + */ +beestat.component.metric.runtime_per_degree_day.auxiliary_heat_2.prototype.get_icon_ = function() { + return 'fire'; +};