Skip to content

Commit

Permalink
Fix automation bug (#19) (#20)
Browse files Browse the repository at this point in the history
* fix : automation node bug fix

* modify : remove README.md , using github release note page
  • Loading branch information
shgood authored Apr 23, 2021
1 parent 4b13ec0 commit b187ce5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 51 deletions.
31 changes: 13 additions & 18 deletions 101-SmartThings.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,23 @@
display:none;
}
.auto__copyurl{
display: inline-block;
position: relative;
width: 70%;
display: inline-block;
position: relative;
width: 70%;
height: 20.0114px;
}
.auto__copyurl__url{
position: absolute;
left: 0px;
position: absolute;
left: 0px;
right: 40px;
}
.auto__copyurl__btn{
position: absolute;
right: 0px;
position: absolute;
right: 0px;
top: 0px;
}
.logging-options div{
cursor:pointer;
cursor:pointer;
}
.logging-options label{
vertical-align:top;
Expand All @@ -219,7 +219,6 @@
justify-content:flex-end;
}
</style>

<script type="text/x-red" data-template-name="device-profile">
<div class="form-row">
<label for="node-input-name">Name</label>
Expand Down Expand Up @@ -280,7 +279,7 @@ <h3>Properties</h3>
</dl>
</script>
<script type="text/x-red" data-template-name="installed-device">
<div class="form-tips" style="margin-bottom:10px;"><b>Note:</b> create token on the SmartThings <b><a href="https://account.smartthings.com/tokens" target="_blank">personal access token page</a></b></div>
<div class="form-tips" style="margin-bottom:10px;"><b>Note:</b> create token on the SmartThings <b><a href="https://account.smartthings.com/tokens" target="_blank">personal access token page</a></b></div>

<div class="form-row">
<label for="node-input-name">Node Name</label>
Expand Down Expand Up @@ -383,7 +382,7 @@ <h3>Properties</h3>
<p><a href="https://smartthings.developer.samsung.com/docs/guides/smartapps/webhook-apps.html" target="_blank">more...</a></p>
<h3>Properties</h3>
<dl class="message-properties">
<dt>Name <span class="property-type">required</span></dt>
<dt>Name</dt>
<dd>A Name for the WebHook endpoint.</dd>
<dt>Endpoint <span class="property-type">required</span></dt>
<dd>A Endpoint that should be invoked during execution.</dd>
Expand Down Expand Up @@ -440,7 +439,7 @@ <h3>Outputs</h3>
<p>This event-device node interacts with installed SmartThings device. When the device changes and an event occurs, the event node can receive the event as a subscriber.</p>
<h3>Properties</h3>
<dl class="message-properties">
<dt>Name <span class="property-type">required</span></dt>
<dt>Name</dt>
<dd>The label of the Device assigned by the user.</dd>
<dt>Device </dt>
<dd>The unique system identifier for this Device.</dd>
Expand Down Expand Up @@ -509,7 +508,7 @@ <h3>Properties</h3>
<p>This status-device node interact with the installed SmartThings device. This node allows you to branch flows based on the state of the device.</p>
<h3>Properties</h3>
<dl class="message-properties">
<dt>Name <span class="property-type">required</span></dt>
<dt>Name</dt>
<dd>The label of the Device assigned by the user.</dd>
<dt>Device </dt>
<dd>The unique system identifier for this Device.</dd>
Expand Down Expand Up @@ -575,7 +574,7 @@ <h3>Properties</h3>
<p>This command-device node interact with the installed SmartThings device. As commands you set, this node changes the state of the device.</p>
<h3>Properties</h3>
<dl class="message-properties">
<dt>Name <span class="property-type">required</span></dt>
<dt>Name</dt>
<dd>The label of the Device assigned by the user.</dd>
<dt>Device </dt>
<dd>The unique system identifier for this Device.</dd>
Expand All @@ -598,7 +597,6 @@ <h3>Properties</h3>
<!-- Node Html End-->

<script type="text/javascript">
// https://api.smartthings.com/v1/devices
SmartThingsApi = {
getLocations: function(token){
return new Promise((resolve,reject)=>{
Expand Down Expand Up @@ -948,7 +946,6 @@ <h3>Properties</h3>
.catch(e=>{console.warn('load capabilities fail : ',e.message||e)})

</script>

<!-- Node Common Script End-->

<!-- Node Script -->
Expand All @@ -964,7 +961,6 @@ <h3>Properties</h3>
const ST_AUTOMATION = 'automation';
const ST_DEVICE_NODES=[ST_EVENT_DEVICE,ST_STATUS_DEVICE,ST_COMMAND_DEVICE]
const ST_NODES=[ST_AUTOMATION,ST_DEVICE_PROFILE,ST_MY_DEVICE,ST_EVENT_DEVICE,ST_STATUS_DEVICE,ST_COMMAND_DEVICE];
// const ST_NODE_VERSION = 20210318
var stDevice = {};

function STRefCheck() {
Expand Down Expand Up @@ -1003,7 +999,6 @@ <h3>Properties</h3>
RED.view.redraw();
}

//210318 STNode compatibility support
RED.nodes.filterNodes({z:RED.workspaces.active(),type:ST_MY_DEVICE})
.filter(n=> n.device && !n.devices)
.forEach(n=> n.devices=[n.device.deviceId]);
Expand Down
3 changes: 0 additions & 3 deletions 101-SmartThings.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = function (RED) {
const ST_MY_DEVICE = 'installed-device';
const ST_AUTOMATION = 'automation';
const ST_NODES=[ST_EVENT_DEVICE,ST_STATUS_DEVICE,ST_COMMAND_DEVICE,ST_DEVICE_PROFILE,ST_MY_DEVICE,ST_AUTOMATION];
const ST_NODE_VERSION = 200330;

// process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;

Expand Down Expand Up @@ -471,8 +470,6 @@ module.exports = function (RED) {
// console.dir(req.headers,{depth:null})
// console.dir(req.body,{depth:null})

next();
return;
var authHeader = x509headerParse(req.headers.authorization);
if(['PING','CONFIRMATION'].includes(req.body.lifecycle)){
next()
Expand Down
30 changes: 1 addition & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,4 @@ It works on browsers that support for ES6 (2015)
For further help, or general discussion, please contact [email protected]

## Copyright and license
Copyright Samsung Automation Studio Team under [the Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).

## Release Note
- 1.1.3 :
- SmartThings Node enhancement
- enable SmartThings nodes, msg/flow/global parameter parameter
- 1.1.2 :
- SmartThings Node bugfix
- Node.js 10.x version support : remove Promise.allSettled
- status-device node bug fix
- 1.1.0 :
- SmartThings Node enhancement
- Updating SmartThings Capabilities specification
- Device-Profile custom capability support
- My-Device node, device multi-select
- Add Location and Room item to the device-list
- Logging option fix
- 1.0.16 :
- Add 'slack-notification' node
- Add 'status-device', 'command-device' node device response logging option
- 1.0.15 : SmartThings Automation node authorization process modify
- 1.0.13 : SmartThings device nodes logging modify
- 1.0.11 :
- Get custom capability spec. dynamically with SmartThings API
- SmartThings Capability spec. update (2020.08.13)
- 1.0.8 : nodered.org, flows page compatibility fix
- 1.0.7 : Node-RED ver.1.1.2 compatibility bug fix
- Nodes credential access modify
- Editor HTML template engine compatibility modify
Copyright Samsung Automation Studio Team under [the Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).
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-samsung-automation-studio-nodes",
"version": "1.1.4",
"version": "1.1.5",
"description": "Samsung Automation Studio Nodes for Node-RED",
"keywords": [
"SmartThings",
Expand Down

0 comments on commit b187ce5

Please sign in to comment.