Plan: fix late for energy plans (#21080)
This commit is contained in:
parent
bfd6fcf790
commit
7294c8b959
4 changed files with 6 additions and 3 deletions
|
|
@ -314,7 +314,7 @@ export default defineComponent({
|
|||
},
|
||||
updateStaticPlan(plan: StaticPlan): void {
|
||||
const timeISO = plan.time.toISOString();
|
||||
const params = this.socBasedPlanning ? { precondition: plan.precondition } : undefined;
|
||||
const params = plan.precondition ? { precondition: plan.precondition } : undefined;
|
||||
if (this.socBasedPlanning) {
|
||||
const p = plan as StaticSocPlan;
|
||||
api.post(`${this.apiVehicle}plan/soc/${p.soc}/${timeISO}`, null, { params });
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ export default defineComponent({
|
|||
selectedSoc: this.soc,
|
||||
selectedEnergy: this.energy,
|
||||
active: false,
|
||||
selectedPrecondition: 0,
|
||||
selectedPrecondition: this.precondition,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
|
|||
|
|
@ -255,8 +255,10 @@ export default defineComponent({
|
|||
},
|
||||
async fetchStaticPreviewEnergy(plan: StaticEnergyPlan): Promise<PlanResponse | undefined> {
|
||||
const timeISO = plan.time.toISOString();
|
||||
const params = plan.precondition ? { precondition: plan.precondition } : undefined;
|
||||
return await this.apiFetchPlan(
|
||||
`loadpoints/${this.id}/plan/static/preview/energy/${plan.energy}/${timeISO}`
|
||||
`loadpoints/${this.id}/plan/static/preview/energy/${plan.energy}/${timeISO}`,
|
||||
params
|
||||
);
|
||||
},
|
||||
async apiFetchPlan(
|
||||
|
|
|
|||
|
|
@ -348,6 +348,7 @@ func (lp *Loadpoint) setPlanEnergy(finishAt time.Time, precondition time.Duratio
|
|||
}
|
||||
|
||||
lp.planTime = finishAt
|
||||
lp.planPrecondition = precondition
|
||||
lp.publish(keys.PlanTime, finishAt)
|
||||
lp.publish(keys.PlanPrecondition, precondition)
|
||||
lp.settings.SetTime(keys.PlanTime, finishAt)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue