type OCPP16DataTransferResponse,
type OCPP16DiagnosticsStatusNotificationResponse,
type OCPP16FirmwareStatusNotificationResponse,
+ type OCPP16GetCompositeScheduleResponse,
type OCPP16HeartbeatResponse,
OCPP16IncomingRequestCommand,
type OCPP16MeterValuesRequest,
private jsonSchemas: Map<OCPP16RequestCommand, JSONSchemaType<JsonObject>>;
public constructor() {
- if (new.target?.name === moduleName) {
- throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
- }
+ // if (new.target?.name === moduleName) {
+ // throw new TypeError(`Cannot construct ${new.target?.name} instances directly`);
+ // }
super(OCPPVersion.VERSION_16);
this.responseHandlers = new Map<OCPP16RequestCommand, ResponseHandler>([
[OCPP16RequestCommand.BOOT_NOTIFICATION, this.handleResponseBootNotification.bind(this)],
'constructor'
),
],
+ [
+ OCPP16IncomingRequestCommand.GET_COMPOSITE_SCHEDULE,
+ OCPP16ServiceUtils.parseJsonSchemaFile<OCPP16GetCompositeScheduleResponse>(
+ '../../../assets/json-schemas/ocpp/1.6/GetCompositeScheduleResponse.json',
+ moduleName,
+ 'constructor'
+ ),
+ ],
[
OCPP16IncomingRequestCommand.SET_CHARGING_PROFILE,
OCPP16ServiceUtils.parseJsonSchemaFile<SetChargingProfileResponse>(
chargingStation,
OCPP16StandardParametersKey.HeartbeatInterval,
payload.interval.toString(),
- Constants.EMPTY_OBJECT,
+ {},
{ overwrite: true, save: true }
);
ChargingStationConfigurationUtils.addConfigurationKey(
{ visible: false },
{ overwrite: true, save: true }
);
- chargingStation.heartbeatSetInterval
- ? chargingStation.restartHeartbeat()
- : chargingStation.startHeartbeat();
+ OCPP16ServiceUtils.startHeartbeatInterval(chargingStation, payload.interval);
}
if (Object.values(RegistrationStatusEnumType).includes(payload.status)) {
const logMsg = `${chargingStation.logPrefix()} Charging station in '${
chargingStation.getConnectorStatus(connectorId)?.transactionRemoteStarted === true &&
chargingStation.getAuthorizeRemoteTxRequests() === true &&
chargingStation.getLocalAuthListEnabled() === true &&
- chargingStation.hasAuthorizedTags() &&
+ chargingStation.hasIdTags() &&
chargingStation.getConnectorStatus(connectorId)?.idTagLocalAuthorized === false
) {
logger.error(