Skip to content

Commit

Permalink
Merge pull request #1109 from JKRhb/opcua-fixes
Browse files Browse the repository at this point in the history
docs(binding-opcua): fix demo-opcua1.ts in README
  • Loading branch information
relu91 authored Oct 10, 2023
2 parents 4c3c203 + 324dbc2 commit 4ebe5e8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/binding-opcua/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ const thingDescription = {
```

```javascript
// examples/src/opcua/dempo-opcua1.ts
// examples/src/opcua/demo-opcua1.ts
import { Servient } from "@node-wot/core";
import { OPCUAClientFactory } from "@node-wot/binding-opcua";

import { thingDescription } from "./demo-opcua-thing-description";
(async () => {
const servient = new Servient();
servient.addClientFactory(new OPCUAClientFactory());
Expand All @@ -51,9 +52,11 @@ import { OPCUAClientFactory } from "@node-wot/binding-opcua";
const thing = await wot.consume(thingDescription);

const content = await thing.readProperty("pumpSpeed");
const json = (await content.value()).valueOf();
const pumpSpeed = await content.value();

console.log("Pump Speed is", json);
console.log("------------------------------");
console.log("Pump Speed is : ", pumpSpeed, "m/s");
console.log("------------------------------");

await servient.shutdown();
})();
Expand Down

0 comments on commit 4ebe5e8

Please sign in to comment.