feat(actions): add click and double click actions
This commit is contained in:
@@ -1,19 +1,3 @@
|
||||
<!--
|
||||
Copyright JS Foundation and other contributors, http://js.foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!-- The Input Node -->
|
||||
<script type="text/x-red" data-template-name="xiaomi-gateway in">
|
||||
<div class="form-row">
|
||||
|
||||
@@ -22,6 +22,7 @@ module.exports = function(RED) {
|
||||
// The Input Node
|
||||
function GatewayIn(n) {
|
||||
RED.nodes.createNode(this,n);
|
||||
this.gateway = RED.nodes.getNode(n.gateway);
|
||||
this.group = "224.0.0.50";
|
||||
this.port = 9898;
|
||||
this.iface = null;
|
||||
@@ -62,6 +63,9 @@ module.exports = function(RED) {
|
||||
jsonMsg.data = JSON.parse(jsonMsg.data) || jsonMsg.data;
|
||||
}
|
||||
msg = { payload: jsonMsg };
|
||||
if(jsonMsg.token && node.gateway && jsonMsg.data.ip && jsonMsg.data.ip === node.gateway.ip) {
|
||||
node.gateway.lastToken = jsonMsg.token;
|
||||
}
|
||||
node.send(msg);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user