}
public openWSConnection(
- options: WsOptions = this.stationInfo?.wsOptions ?? {},
- params: { closeOpened?: boolean; terminateOpened?: boolean } = {
- closeOpened: false,
- terminateOpened: false,
- },
+ options?: WsOptions,
+ params?: { closeOpened?: boolean; terminateOpened?: boolean },
): void {
- options = { handshakeTimeout: secondsToMilliseconds(this.getConnectionTimeout()), ...options };
+ options = {
+ handshakeTimeout: secondsToMilliseconds(this.getConnectionTimeout()),
+ ...(this.stationInfo?.wsOptions ?? {}),
+ ...options,
+ };
params = { ...{ closeOpened: false, terminateOpened: false }, ...params };
if (this.started === false && this.starting === false) {
logger.warn(
);
this.openWSConnection(
{
- ...(this.stationInfo?.wsOptions ?? {}),
handshakeTimeout: reconnectTimeout,
},
{ closeOpened: true },
chargingStation: ChargingStation,
key: ConfigurationKeyType,
value: string,
- options: ConfigurationKeyOptions = {
- readonly: false,
- visible: true,
- reboot: false,
- },
- params: AddConfigurationKeyParams = { overwrite: false, save: false },
+ options?: ConfigurationKeyOptions,
+ params?: AddConfigurationKeyParams,
): void => {
options = {
...{
export const deleteConfigurationKey = (
chargingStation: ChargingStation,
key: ConfigurationKeyType,
- params: DeleteConfigurationKeyParams = { save: true, caseInsensitive: false },
+ params?: DeleteConfigurationKeyParams,
): ConfigurationKey[] | undefined => {
params = { ...{ save: true, caseInsensitive: false }, ...params };
const keyFound = getConfigurationKey(chargingStation, key, params?.caseInsensitive);
export const createSerialNumber = (
stationTemplate: ChargingStationTemplate,
stationInfo: ChargingStationInfo,
- params: {
+ params?: {
randomSerialNumberUpperCase?: boolean;
randomSerialNumber?: boolean;
- } = {
- randomSerialNumberUpperCase: true,
- randomSerialNumber: true,
},
): void => {
params = { ...{ randomSerialNumberUpperCase: true, randomSerialNumber: true }, ...params };
messageId: string,
messagePayload: JsonType,
commandName: RequestCommand,
- params: RequestParams = defaultRequestParams,
+ params?: RequestParams,
): Promise<ResponseType> {
params = {
...defaultRequestParams,
messagePayload: JsonType | OCPPError,
messageType: MessageType,
commandName: RequestCommand | IncomingRequestCommand,
- params: RequestParams = defaultRequestParams,
+ params?: RequestParams,
): Promise<ResponseType> {
params = {
...defaultRequestParams,
PerformanceStatistics.endMeasure(commandName, beginId);
}
const wsClosedOrErrored = !wsOpened || sendError === true;
- if (wsClosedOrErrored && params.skipBufferingOnError === false) {
+ if (wsClosedOrErrored && params?.skipBufferingOnError === false) {
// Buffer
chargingStation.bufferMessage(messageToSend);
// Reject and keep request in the cache
protected static getLimitFromSampledValueTemplateCustomValue(
value: string,
limit: number,
- options: { limitationEnabled?: boolean; unitMultiplier?: number } = {
- limitationEnabled: true,
- unitMultiplier: 1,
- },
+ options?: { limitationEnabled?: boolean; unitMultiplier?: number },
): number {
options = {
...{