name="number-of-stations"
placeholder="number of stations"
/>
+ <p>Options:</p>
+ <ul>
+ <li>
+ Auto start:
+ <input v-model="state.autoStart" type="checkbox" true-value="true" false-value="false" />
+ </li>
+ </ul>
<br />
<Button
id="action-button"
@click="
() => {
uiClient
- .addChargingStations(state.template, state.numberOfStations)
+ .addChargingStations(state.template, state.numberOfStations, {
+ autoStart: convertToBoolean(state.autoStart)
+ })
.then(() => {
$toast.success('Charging stations successfully added')
})
import { useToast } from 'vue-toast-notification'
import Button from '@/components/buttons/Button.vue'
import type { ResponsePayload } from '@/types'
+import { convertToBoolean } from '@/composables'
const state = reactive({
ready: false,
template: '',
- numberOfStations: 1
+ numberOfStations: 1,
+ autoStart: false
})
const app = getCurrentInstance()
@click="
() => {
uiClient
- .startTransaction(props.hashId, parseInt(props.connectorId), state.idTag)
+ .startTransaction(props.hashId, convertToInt(props.connectorId), state.idTag)
.then(() => {
$toast.success('Transaction successfully started')
})
<script setup lang="ts">
import { getCurrentInstance, reactive } from 'vue'
import Button from '@/components/buttons/Button.vue'
+import { convertToInt } from '@/composables'
const props = defineProps<{
hashId: string
import {
ApplicationProtocol,
AuthenticationType,
+ type ChargingStationOptions,
ProcedureName,
type ProtocolResponse,
type RequestPayload,
public async addChargingStations(
template: string,
- numberOfStations: number
+ numberOfStations: number,
+ options?: ChargingStationOptions
): Promise<ResponsePayload> {
- return this.sendRequest(ProcedureName.ADD_CHARGING_STATIONS, { template, numberOfStations })
+ return this.sendRequest(ProcedureName.ADD_CHARGING_STATIONS, {
+ template,
+ numberOfStations,
+ options
+ })
}
public async deleteChargingStation(hashId: string): Promise<ResponsePayload> {
export { UIClient } from './UIClient'
+export { convertToBoolean, convertToInt } from './Utils'
} as const
export type FirmwareStatus = OCPP16FirmwareStatus
+export interface ChargingStationOptions extends JsonObject {
+ supervisionUrls?: string | string[]
+ persistentConfiguration?: boolean
+ autoStart?: boolean
+ autoRegister?: boolean
+ enableStatistics?: boolean
+ ocppStrictCompliance?: boolean
+ stopTransactionsOnStopped?: boolean
+}
+
export type ChargingStationInfo = {
hashId: string
templateIndex: number
export type {
ChargingStationData,
ChargingStationInfo,
+ ChargingStationOptions,
ConnectorStatus,
Status
} from './ChargingStationType'