1
0
mirror of https://github.com/beestat/app.git synced 2025-07-09 03:04:07 -04:00

Fixed #196 - Runtime Detail is showing °F data even though the units show °C

Forgot to account for this on all of the series.
This commit is contained in:
Jon Ziebell 2019-12-17 06:33:51 -05:00
parent f0a8f24b59
commit 58a22f009b
2 changed files with 16 additions and 12 deletions

View File

@ -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;

View File

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