UI: allow vehicle charging limit below 20%, include api-set values (#32460)

This commit is contained in:
Michael Geers 2026-08-03 08:52:44 +02:00 • committed by GitHub
parent 5555395cd7
commit ac5d384e39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 3 deletions

View file

@ -40,11 +40,15 @@ export default defineComponent({
},
options() {
const result = [];
const start = this.rangeActive ? this.minTemp : 20;
const start = this.rangeActive ? this.minTemp : 5;
const end = this.rangeActive ? this.maxTemp : 100;
for (let soc = start; soc <= end; soc += this.step) {
const name = this.fmtSocOption(soc, this.rangePerSoc, distanceUnit(), this.heating);
result.push({ value: soc, name });
result.push(this.socOption(soc));
}
// include current value if it's not in the list
if (this.limitSoc && !result.some((o) => o.value === this.limitSoc)) {
result.push(this.socOption(this.limitSoc));
result.sort((a, b) => a.value - b.value);
}
return result;
},
@ -61,6 +65,10 @@ export default defineComponent({
},
},
methods: {
socOption(soc: number) {
const name = this.fmtSocOption(soc, this.rangePerSoc, distanceUnit(), this.heating);
return { value: soc, name };
},
change(e: Event) {
return this.$emit(
"limit-soc-updated",