From a4c421bf5fe527556df3715a30ee998a85560614 Mon Sep 17 00:00:00 2001 From: jongsu2 Date: Mon, 29 Jul 2024 14:47:00 +0900 Subject: [PATCH] fix-smartthings-component --- 101-SmartThings.html | 12 +++++++----- 101-SmartThings.js | 1 + package.json | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/101-SmartThings.html b/101-SmartThings.html index 1bde589f..797eb9d1 100644 --- a/101-SmartThings.html +++ b/101-SmartThings.html @@ -2118,7 +2118,7 @@

Properties

this.deviceNodeId = selectedDeviceOption.dataset?.deviceNodeId; } const selectedCapabilityOption = document.querySelector('#node-input-capabilityId').selectedOptions[0]; - if (selectedDeviceOption && selectedDeviceOption.dataset.deviceNodeId) { + if (selectedCapabilityOption && selectedCapabilityOption.dataset.componentId) { this.componentId = selectedCapabilityOption.dataset?.componentId; } }, @@ -2221,8 +2221,9 @@

Properties

if (selectedOption && selectedOption.dataset.deviceNodeId) { this.deviceNodeId = selectedOption.dataset?.deviceNodeId; } - if (selectedOption && selectedOption.dataset.componentId) { - this.componentId = selectedOption.dataset?.componentId; + const selectedCapabilityOption = document.querySelector('#node-input-capabilityId').selectedOptions[0]; + if (selectedCapabilityOption && selectedCapabilityOption.dataset.componentId) { + this.componentId = selectedCapabilityOption.dataset?.componentId; } }, oneditprepare: function () { @@ -2400,8 +2401,9 @@

Properties

if (selectedOption && selectedOption.dataset.deviceNodeId) { this.deviceNodeId = selectedOption.dataset?.deviceNodeId; } - if (selectedOption && selectedOption.dataset.componentId) { - this.componentId = selectedOption.dataset?.componentId; + const selectedCapabilityOption = document.querySelector('#node-input-capabilityId').selectedOptions[0]; + if (selectedCapabilityOption && selectedCapabilityOption.dataset.componentId) { + this.componentId = selectedCapabilityOption.dataset?.componentId; } }, oneditprepare: function () { diff --git a/101-SmartThings.js b/101-SmartThings.js index ffeb3f6b..f687f51b 100644 --- a/101-SmartThings.js +++ b/101-SmartThings.js @@ -591,6 +591,7 @@ module.exports = function (RED) { var param = {deviceId: ""}; if (RED.nodes.getNode(NODE.deviceNodeId).type == ST_MY_DEVICE) { + deviceConfig = { deviceId: NODE.deviceId, componentId: NODE.componentId }; authToken = RED.nodes.getCredentials(NODE.deviceNodeId).stAccessToken; param.deviceId = NODE.deviceId || RED.nodes.getNode(NODE.deviceNodeId).device.deviceId } else { diff --git a/package.json b/package.json index 75011d9c..f7af23bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-samsung-automation-studio-nodes", - "version": "1.1.21", + "version": "1.1.22", "description": "Samsung Automation Studio Nodes for Node-RED", "keywords": [ "SmartThings",