-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect AuthorizeRemoteStart config option when starting a session
- Loading branch information
1 parent
3e057cd
commit ce565ca
Showing
12 changed files
with
76 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/lib/ChargeStation/eventHandlers/ocpp-16/send-authorize-or-start-transaction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ChargeStationEventHandler } from 'lib/ChargeStation/eventHandlers'; | ||
import sendAuthorize from 'lib/ChargeStation/eventHandlers/ocpp-16/send-authorize'; | ||
import sendStartTransaction from 'lib/ChargeStation/eventHandlers/ocpp-16/send-start-transaction'; | ||
|
||
const sendAuthorizeOrStartTransaction: ChargeStationEventHandler = async ( | ||
params | ||
) => { | ||
if (params.session.options?.skipAuthorize !== true) { | ||
return sendAuthorize(params); | ||
} | ||
return sendStartTransaction(params); | ||
}; | ||
|
||
export default sendAuthorizeOrStartTransaction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/lib/ChargeStation/eventHandlers/ocpp-20/send-authorize-or-start-transaction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { | ||
ChargeStationEventHandler, | ||
ChargeStationEventHandlerParams, | ||
} from 'lib/ChargeStation/eventHandlers'; | ||
import sendStartTransaction from 'lib/ChargeStation/eventHandlers/ocpp-20/send-start-transaction'; | ||
import sendAuthorize from 'lib/ChargeStation/eventHandlers/ocpp-20/send-authorize'; | ||
import { AuthorizeRequest } from 'schemas/ocpp/2.0/AuthorizeRequest'; | ||
import { AuthorizeResponse } from 'schemas/ocpp/2.0/AuthorizeResponse'; | ||
|
||
const sendAuthorizeOrStartTransaction: ChargeStationEventHandler = async ( | ||
params | ||
) => { | ||
if (params.session.options?.skipAuthorize !== true) { | ||
return sendAuthorize( | ||
params as ChargeStationEventHandlerParams< | ||
AuthorizeRequest, | ||
AuthorizeResponse | ||
> | ||
); | ||
} | ||
|
||
return sendStartTransaction(params); | ||
}; | ||
|
||
export default sendAuthorizeOrStartTransaction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters