Skip to content

Commit

Permalink
v2.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Luiz committed May 18, 2024
1 parent 199d43c commit 5a99cb0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions docs/modules/cs/index.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Sets up a central system, that can communicate with charge points

- [Central System](#central-system)
- [CentralSystem (class)](#centralsystem-class)
- [getConnectedChargePoints (method)](#getconnectedchargepoints-method)
- [addConnectionListener (method)](#addconnectionlistener-method)
- [close (method)](#close-method)
- [sendRequest (method)](#sendrequest-method)
Expand Down Expand Up @@ -64,6 +65,14 @@ const centralSystem = new CentralSystem(3000, (req, { chargePointId }) => {
})
```

### getConnectedChargePoints (method)

**Signature**

```ts
public getConnectedChargePoints(): string[]
```

### addConnectionListener (method)

**Signature**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@voltbras/ts-ocpp",
"description": "OCPP (Open Charge Point Protocol) implemented in Typescript",
"version": "2.11.1",
"version": "2.12.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"homepage": "https://github.com/voltbras/ts-ocpp",
Expand Down
6 changes: 5 additions & 1 deletion src/cs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export default class CentralSystem {
this.websocketsServer = this.setupWebsocketsServer();
}

public getConnectedChargePoints(): string[] {
return Object.keys(this.connections);
}

public addConnectionListener(listener: ConnectionListener) {
this.listeners.push(listener);
}
Expand Down Expand Up @@ -363,4 +367,4 @@ export default class CentralSystem {
this.listeners.forEach((f) => f(chargePointId, 'disconnected'));
});
}
}
}

0 comments on commit 5a99cb0

Please sign in to comment.