From 58a22f009b2741e96c7d91d6b251b5f64e1f4b35 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Tue, 17 Dec 2019 06:33:51 -0500 Subject: [PATCH] =?UTF-8?q?Fixed=20#196=20-=20Runtime=20Detail=20is=20show?= =?UTF-8?q?ing=20=C2=B0F=20data=20even=20though=20the=20units=20show=20?= =?UTF-8?q?=C2=B0C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forgot to account for this on all of the series. --- js/beestat/temperature.js | 6 ++---- js/component/card/runtime_detail.js | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/js/beestat/temperature.js b/js/beestat/temperature.js index a1a2bc3..b74f033 100644 --- a/js/beestat/temperature.js +++ b/js/beestat/temperature.js @@ -15,8 +15,6 @@ */ // beestat.temperature = function(temperature, convert, round, include_units) { beestat.temperature = function(args) { - var thermostat = beestat.cache.thermostat[beestat.setting('thermostat_id')]; - // Allow passing a single argument of temperature for convenience. if (typeof args !== 'object' || args === null) { args = { @@ -38,7 +36,7 @@ beestat.temperature = function(args) { } // Convert to Celcius if necessary and asked for. - if (convert === true && thermostat.temperature_unit === '°C') { + if (convert === true && beestat.setting('temperature_unit') === '°C') { if (delta === true) { temperature *= (5 / 9); } else { @@ -65,7 +63,7 @@ beestat.temperature = function(args) { // Append units if asked for. if (units === true) { - temperature += thermostat.temperature_unit; + temperature += beestat.setting('temperature_unit'); } return temperature; diff --git a/js/component/card/runtime_detail.js b/js/component/card/runtime_detail.js index b81a578..ecbd7f8 100644 --- a/js/component/card/runtime_detail.js +++ b/js/component/card/runtime_detail.js @@ -434,12 +434,16 @@ beestat.component.card.runtime_detail.prototype.get_data_ = function() { data.series.outdoor_humidity.push(outdoor_humidity_moving); data.metadata.series.outdoor_humidity.active = true; - var indoor_temperature_moving = this.get_average_(moving, 'indoor_temperature'); + var indoor_temperature_moving = beestat.temperature( + this.get_average_(moving, 'indoor_temperature') + ); data.series.indoor_temperature.push(indoor_temperature_moving); y_min_max(indoor_temperature_moving); data.metadata.series.indoor_temperature.active = true; - var outdoor_temperature_moving = this.get_average_(moving, 'outdoor_temperature'); + var outdoor_temperature_moving = beestat.temperature( + this.get_average_(moving, 'outdoor_temperature') + ); data.series.outdoor_temperature.push(outdoor_temperature_moving); y_min_max(outdoor_temperature_moving); data.metadata.series.outdoor_temperature.active = true; @@ -453,13 +457,14 @@ beestat.component.card.runtime_detail.prototype.get_data_ = function() { runtime_thermostat.system_mode === 'heat' || runtime_thermostat.system_mode === 'auxiliary_heat' ) { - data.series.setpoint_heat.push( - beestat.temperature(runtime_thermostat.setpoint_heat) + var setpoint_heat = beestat.temperature( + runtime_thermostat.setpoint_heat ); + data.series.setpoint_heat.push(setpoint_heat); + y_min_max(setpoint_heat); data.metadata.series.setpoint_heat.active = true; - y_min_max(runtime_thermostat.setpoint_heat); } else { data.series.setpoint_heat.push(null); } @@ -468,13 +473,14 @@ beestat.component.card.runtime_detail.prototype.get_data_ = function() { runtime_thermostat.system_mode === 'auto' || runtime_thermostat.system_mode === 'cool' ) { - data.series.setpoint_cool.push( - beestat.temperature(runtime_thermostat.setpoint_cool) + var setpoint_cool = beestat.temperature( + runtime_thermostat.setpoint_cool ); + data.series.setpoint_cool.push(setpoint_cool); + y_min_max(setpoint_cool); data.metadata.series.setpoint_cool.active = true; - y_min_max(runtime_thermostat.setpoint_cool); } else { data.series.setpoint_cool.push(null); }