Skip to content

Commit

Permalink
UI: show real battery buffer start value
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis committed Oct 9, 2024
1 parent 95cab8d commit e674962
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions assets/js/components/BatterySettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
@change="changeBufferStart"
>
<span class="text-decoration-underline">
{{ bufferStartOption.name }}
{{ selectedBufferStartName }}
</span>
</CustomSelect>
</small>
Expand Down Expand Up @@ -332,9 +332,7 @@ export default {
for (let i = 100; i >= this.bufferSoc; i -= 5) {
options.push({
value: i,
name: this.$t(`batterySettings.bufferStart.${i === 100 ? "full" : "above"}`, {
soc: this.fmtSoc(i),
}),
name: this.getBufferStartName(i),
});
}
options.push({
Expand All @@ -346,6 +344,9 @@ export default {
bufferStartOption() {
return this.bufferStartOptions.find((option) => this.bufferStartSoc >= option.value);
},
selectedBufferStartName() {
return this.getBufferStartName(this.selectedBufferStartSoc);
},
topHeight() {
return 100 - (this.bufferSoc || 100);
},
Expand Down Expand Up @@ -488,6 +489,11 @@ export default {
console.error(err);
}
},
getBufferStartName(soc) {
return this.$t(`batterySettings.bufferStart.${soc === 100 ? "full" : "above"}`, {
soc: this.fmtSoc(soc),
});
},
},
};
</script>
Expand Down

0 comments on commit e674962

Please sign in to comment.