chargingStation: ChargingStation,
commandPayload: ResetRequest
): GenericResponse {
- this.asyncResource
- .runInAsyncScope(
- chargingStation.reset.bind(chargingStation) as (
- this: ChargingStation,
- ...args: any[]
- ) => Promise<void>,
- chargingStation,
- `${commandPayload.type}Reset` as OCPP16StopTransactionReason
- )
- .catch(() => {
- /* This is intentional */
- });
+ this.runInAsyncScope(
+ chargingStation.reset.bind(chargingStation) as (
+ this: ChargingStation,
+ ...args: any[]
+ ) => Promise<void>,
+ chargingStation,
+ `${commandPayload.type}Reset` as OCPP16StopTransactionReason
+ ).catch(() => {
+ /* This is intentional */
+ });
logger.info(
`${chargingStation.logPrefix()} ${
commandPayload.type
): GetConfigurationResponse {
const configurationKey: OCPPConfigurationKey[] = [];
const unknownKey: string[] = [];
- if (Utils.isEmptyArray(commandPayload.key) === true) {
+ if (Utils.isUndefined(commandPayload.key) === true) {
for (const configuration of chargingStation.ocppConfiguration.configurationKey) {
if (Utils.isUndefined(configuration.visible) === true) {
configuration.visible = true;
value: configuration.value,
});
}
- } else {
+ } else if (Utils.isNotEmptyArray(commandPayload.key) === true) {
for (const key of commandPayload.key) {
const keyFound = ChargingStationConfigurationUtils.getConfigurationKey(
chargingStation,
- key
+ key,
+ true
);
if (keyFound) {
if (Utils.isUndefined(keyFound.visible) === true) {
const connectorStatus = chargingStation.getConnectorStatus(commandPayload.connectorId);
if (
!Utils.isNullOrUndefined(commandPayload.connectorId) &&
- !Utils.isEmptyArray(connectorStatus?.chargingProfiles)
+ Utils.isNotEmptyArray(connectorStatus?.chargingProfiles)
) {
connectorStatus.chargingProfiles = [];
logger.debug(
let clearedCP = false;
for (const connectorId of chargingStation.connectors.keys()) {
if (
- !Utils.isEmptyArray(chargingStation.getConnectorStatus(connectorId)?.chargingProfiles)
+ Utils.isNotEmptyArray(chargingStation.getConnectorStatus(connectorId)?.chargingProfiles)
) {
chargingStation
.getConnectorStatus(connectorId)
const retrieveDate = Utils.convertToDate(commandPayload.retrieveDate);
const now = Date.now();
if (retrieveDate?.getTime() <= now) {
- this.asyncResource
- .runInAsyncScope(
- this.updateFirmware.bind(this) as (
- this: OCPP16IncomingRequestService,
- ...args: any[]
- ) => Promise<void>,
- this,
- chargingStation
- )
- .catch(() => {
- /* This is intentional */
- });
+ this.runInAsyncScope(
+ this.updateFirmware.bind(this) as (
+ this: OCPP16IncomingRequestService,
+ ...args: any[]
+ ) => Promise<void>,
+ this,
+ chargingStation
+ ).catch(() => {
+ /* This is intentional */
+ });
} else {
setTimeout(() => {
this.updateFirmware(chargingStation).catch(() => {