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); }