Skip to content

Commit

Permalink
Merge pull request #10 from shiv3/hotfix/fix-metervalue-transactionid
Browse files Browse the repository at this point in the history
add transaction_id to metervalue
  • Loading branch information
shiv3 authored Oct 6, 2024
2 parents 9ecd009 + ec74850 commit cc33093
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cp/ChargePoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class ChargePoint {
public sendMeterValue(connectorId: number): void {
const connector = this.getConnector(connectorId);
if (connector) {
this._messageHandler.sendMeterValue(connectorId, connector.meterValue);
this._messageHandler.sendMeterValue(connector.transaction?.id ?? undefined, connectorId, connector.meterValue);
} else {
this._logger.error(`Connector ${connectorId} not found`);
}
Expand Down
3 changes: 2 additions & 1 deletion src/cp/OCPPMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ export class OCPPMessageHandler {
);
}

public sendMeterValue(connectorId: number, meterValue: number): void {
public sendMeterValue(transactionId:number|undefined,connectorId: number, meterValue: number): void {
const messageId = this.generateMessageId();
const payload: request.MeterValuesRequest = {
transactionId: transactionId,
connectorId: connectorId,
meterValue: [
{
Expand Down

0 comments on commit cc33093

Please sign in to comment.