From 324dbc238bb5bbd2f2f84d90a31f5dee2ce3ef5a Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 9 Oct 2023 17:05:06 +0200 Subject: [PATCH] docs(binding-opcua): fix demo-opcua1.ts in README --- packages/binding-opcua/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/binding-opcua/README.md b/packages/binding-opcua/README.md index 7e534a37f..e19236364 100644 --- a/packages/binding-opcua/README.md +++ b/packages/binding-opcua/README.md @@ -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()); @@ -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(); })();