Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
biancode committed Dec 14, 2022
2 parents a95dbfd + e12e798 commit f781c2b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-iiot-opcua",
"version": "4.1.1",
"version": "4.1.2",
"description": "An Industrial IoT OPC UA toolbox contribution package for Node-RED based on node-opcua.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/core/opcua-iiot-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ export function normalizeMessage(msg: WriteMessage) {

if (!isNotDefined(writeValues)) {
return addressSpaceValues.map((item, index) => {
return {...item, value: writeValues[index] || ''}
return {...item, value: _.isUndefined(writeValues[index]) ? null : writeValues[index]}
})
} else
return addressSpaceValues.map((item, index) => {
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/opcua-iiot-flex-server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ describe("OPC UA Flex Server Node E2E testing", () => {
expect(msg.payload.value[0].statusCode).toBeDefined()
expect(msg.payload.value[0].statusCode.value).toBe(0)
expect(msg.payload.value[0].value?.value).toBeDefined()
expect(msg.payload.value[0].value?.value).toBe(0)
expect(msg.payload.value[0].value?.dataType).toBe("Double")
expect(msg.payload.injectType).toBe("read")
done()
})
Expand Down

0 comments on commit f781c2b

Please sign in to comment.