} from '../types';
export const buildStartedMessage = (
- chargingStation: ChargingStation
+ chargingStation: ChargingStation,
): ChargingStationWorkerMessage<ChargingStationData> => {
return {
- id: ChargingStationWorkerMessageEvents.started,
+ event: ChargingStationWorkerMessageEvents.started,
data: buildChargingStationDataPayload(chargingStation),
};
};
export const buildStoppedMessage = (
- chargingStation: ChargingStation
+ chargingStation: ChargingStation,
): ChargingStationWorkerMessage<ChargingStationData> => {
return {
- id: ChargingStationWorkerMessageEvents.stopped,
+ event: ChargingStationWorkerMessageEvents.stopped,
data: buildChargingStationDataPayload(chargingStation),
};
};
export const buildUpdatedMessage = (
- chargingStation: ChargingStation
+ chargingStation: ChargingStation,
): ChargingStationWorkerMessage<ChargingStationData> => {
return {
- id: ChargingStationWorkerMessageEvents.updated,
+ event: ChargingStationWorkerMessageEvents.updated,
data: buildChargingStationDataPayload(chargingStation),
};
};
export const buildPerformanceStatisticsMessage = (
- statistics: Statistics
+ statistics: Statistics,
): ChargingStationWorkerMessage<Statistics> => {
return {
- id: ChargingStationWorkerMessageEvents.performanceStatistics,
+ event: ChargingStationWorkerMessageEvents.performanceStatistics,
data: statistics,
};
};
stationInfo: chargingStation.stationInfo,
connectors: buildConnectorsStatus(chargingStation),
evses: buildEvsesStatus(chargingStation, OutputFormat.worker),
- ocppConfiguration: chargingStation.ocppConfiguration,
+ ocppConfiguration: chargingStation.ocppConfiguration!,
wsState: chargingStation?.wsConnection?.readyState,
bootNotificationResponse: chargingStation.bootNotificationResponse,
...(chargingStation.automaticTransactionGenerator && {