Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,27 @@ export default {
template,
);
},
scheduledChargingPlanHours(time) {
return parseInt(time.split(":")[0], 10);
},
scheduledChargingPlanMinutes(time) {
return parseInt(time.split(":")[1], 10);
},
setChargePointConnectedVehicleScheduledChargingPlanTime(
id,
plan_id,
hours,
minutes,
) {
const newTime = `${String(hours).padStart(2, "0")}:${String(minutes,).padStart(2, "0")}`;
const templateTopic = `openWB/chargepoint/${id}/set/charge_template`;
const template = this.mqttStore.updateState(
templateTopic,
newTime,
`chargemode.scheduled_charging.plans.${plan_id}.time`,
);
this.$root.sendTopicToBroker(templateTopic, template);
},
},
};
</script>
Expand Down Expand Up @@ -1287,84 +1308,125 @@ export default {
Es wurden noch keine Zeitpläne für das Zielladen eingerichtet.
</i-alert>
<i-form v-else>
<i-form-group
<div
v-for="(
plan, planKey
) in mqttStore.getChargePointConnectedVehicleScheduledChargingPlans(
modalChargePointId,
)"
:key="planKey"
>
<i-container>
<i-row>
<i-button
size="lg"
block
:color="plan.active ? 'success' : 'danger'"
@click="
setChargePointConnectedVehicleScheduledChargingPlanActive(
modalChargePointId,
planKey,
!plan.active,
)
"
>
<div class="plan-name">
{{ plan.name }}
</div>
<div class="plan-details">
<div v-if="plan.frequency.selected == 'once'">
<font-awesome-icon
:icon="['fas', 'calendar-day']"
/>
{{ mqttStore.formatDate(plan.frequency.once) }}
</div>
<div v-if="plan.frequency.selected == 'daily'">
<font-awesome-icon
:icon="['fas', 'calendar-week']"
/>
täglich
</div>
<div v-if="plan.frequency.selected == 'weekly'">
<font-awesome-icon
:icon="['fas', 'calendar-alt']"
/>
{{
mqttStore.formatWeeklyScheduleDays(plan.frequency.weekly)
}}
</div>
<div>
<font-awesome-icon
:icon="['fas', 'clock']"
/>
{{ plan.time }}
</div>
<div v-if="plan.limit.selected == 'soc'">
<font-awesome-icon
:icon="['fas', 'car-battery']"
/>
{{ plan.limit.soc_scheduled }}&nbsp;%
<font-awesome-icon
:icon="['fas', plan.bidi_charging_enabled ? 'right-left' : 'right-long']"
/>
{{ plan.limit.soc_limit }}&nbsp;%
</div>
<div v-if="plan.limit.selected == 'amount'">
<font-awesome-icon
:icon="['fas', 'bolt']"
/>
{{ plan.limit.amount / 1000 }}&nbsp;kWh
<i-form-group>
<i-container>
<i-row>
<i-button
size="lg"
block
:color="plan.active ? 'success' : 'danger'"
@click="
setChargePointConnectedVehicleScheduledChargingPlanActive(
modalChargePointId,
planKey,
!plan.active,
)
"
>
<div class="plan-name">
{{ plan.name }}
</div>
<div v-if="plan.et_active">
<font-awesome-icon
:icon="['fas', 'coins']"
/>
<div class="plan-details">
<div v-if="plan.frequency.selected == 'once'">
<font-awesome-icon
:icon="['fas', 'calendar-day']"
/>
{{ mqttStore.formatDate(plan.frequency.once) }}
</div>
<div v-if="plan.frequency.selected == 'daily'">
<font-awesome-icon
:icon="['fas', 'calendar-week']"
/>
täglich
</div>
<div v-if="plan.frequency.selected == 'weekly'">
<font-awesome-icon
:icon="['fas', 'calendar-alt']"
/>
{{
mqttStore.formatWeeklyScheduleDays(plan.frequency.weekly)
}}
</div>
<div>
<font-awesome-icon
:icon="['fas', 'clock']"
/>
{{ plan.time }}
</div>
<div v-if="plan.limit.selected == 'soc'">
<font-awesome-icon
:icon="['fas', 'car-battery']"
/>
{{ plan.limit.soc_scheduled }}&nbsp;%
<font-awesome-icon
:icon="['fas', plan.bidi_charging_enabled ? 'right-left' : 'right-long']"
/>
{{ plan.limit.soc_limit }}&nbsp;%
</div>
<div v-if="plan.limit.selected == 'amount'">
<font-awesome-icon
:icon="['fas', 'bolt']"
/>
{{ plan.limit.amount / 1000 }}&nbsp;kWh
</div>
<div v-if="plan.et_active">
<font-awesome-icon
:icon="['fas', 'coins']"
/>
</div>
</div>
</div>
</i-button>
</i-button>
</i-row>
</i-container>
</i-form-group>
<i-form-group class="_margin-bottom:2">
<i-form-label>Ziel-Termin</i-form-label>
<i-row>
<i-column class="_margin-bottom:1">
<extended-number-input
unit="Uhr"
:min="0"
:max="23"
:step="1"
:model-value="scheduledChargingPlanHours(plan.time)"
@update:model-value="
setChargePointConnectedVehicleScheduledChargingPlanTime(
modalChargePointId,
planKey,
$event,
scheduledChargingPlanMinutes(plan.time),
)
"
/>
</i-column>
<i-column class="_margin-bottom:1">
<extended-number-input
unit="Min."
:min="0"
:max="55"
:step="5"
:model-value="scheduledChargingPlanMinutes(plan.time)"
@update:model-value="
setChargePointConnectedVehicleScheduledChargingPlanTime(
modalChargePointId,
planKey,
scheduledChargingPlanHours(plan.time),
$event,
)
"
/>
</i-column>
</i-row>
</i-container>
</i-form-group>
</i-form-group>
</div>
</i-form>
</i-tab>
<i-tab
Expand Down Expand Up @@ -1547,3 +1609,4 @@ export default {
margin-right: 0.5em;
}
</style>

Loading