Heating: fix temp limit (#10994)
This commit is contained in:
parent
93efec2521
commit
755af25d6b
3 changed files with 7 additions and 5 deletions
|
|
@ -65,8 +65,7 @@ export default {
|
|||
return null;
|
||||
},
|
||||
formatSoc: function (value) {
|
||||
// todo: add fahrenheit support
|
||||
return this.heating ? this.fmtNumber(value, 1, "celsius") : `${Math.round(value)}%`;
|
||||
return this.heating ? this.fmtTemperature(value) : `${Math.round(value)}%`;
|
||||
},
|
||||
formatKm: function (value) {
|
||||
return `${this.fmtNumber(value, 0)} ${distanceUnit()}`;
|
||||
|
|
|
|||
|
|
@ -155,8 +155,7 @@ export default {
|
|||
return "--";
|
||||
}
|
||||
if (this.heating) {
|
||||
// todo: add celsius/fahrenheit option to ui
|
||||
return this.fmtNumber(this.vehicleSoc, 1, "celsius");
|
||||
return this.fmtTemperature(this.vehicleSoc);
|
||||
}
|
||||
return `${Math.round(this.vehicleSoc)}%`;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -238,12 +238,16 @@ export default {
|
|||
return rtf.format(Math.round(elapsed / units[u]), u);
|
||||
},
|
||||
fmtSocOption: function (soc, rangePerSoc, distanceUnit, heating) {
|
||||
let result = heating ? this.fmtNumber(soc, 1, "celcius") : `${this.fmtNumber(soc, 0)}%`;
|
||||
let result = heating ? this.fmtTemperature(soc) : `${this.fmtNumber(soc, 0)}%`;
|
||||
if (rangePerSoc && distanceUnit) {
|
||||
const range = soc * rangePerSoc;
|
||||
result += ` (${this.fmtNumber(range, 0)} ${distanceUnit})`;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
fmtTemperature: function (value) {
|
||||
// TODO: handle fahrenheit
|
||||
return this.fmtNumber(value, 1, "celsius");
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue