Fix co2 grid charge (#22440)

This commit is contained in:
Michael Geers 2025-07-18 18:40:03 +02:00 • committed by GitHub
parent 4b5d0762e3
commit 0bbd39333c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -247,7 +247,7 @@
:current-limit="batteryGridChargeLimit"
:smart-cost-type="smartCostType"
:currency="currency"
:tariff="forecast?.grid"
:tariff="gridChargeTariff"
:possible="gridChargePossible"
/>
</GenericModal>
@ -315,6 +315,12 @@ export default defineComponent({
gridChargePossible() {
return this.controllable && this.isModalVisible && this.smartCostAvailable;
},
gridChargeTariff() {
if (this.smartCostType === SMART_COST_TYPE.CO2) {
return this.forecast?.co2;
}
return this.forecast?.grid;
},
bufferOptions() {
const options = [];
for (let i = 100; i >= 5; i -= 5) {