update
This commit is contained in:
parent
12e3ab99b8
commit
6f5ab1fb6a
@ -1,18 +1,19 @@
|
||||
{
|
||||
"name": "node-red-contrib-combined-rn-thermostat",
|
||||
"version": "1.0.0",
|
||||
"name": "@vvzvlad/node-red-contrib-rn-combined-nodes",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"keywords": [ "node-red" ],
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.vvzvlad.xyz/vvzvlad/node-red-contrib-combined-rn-thermostat"
|
||||
"url": "https://gitea.vvzvlad.xyz/vvzvlad/node-red-contrib-rn-combined-nodes"
|
||||
},
|
||||
"node-red" : {
|
||||
"nodes": {
|
||||
"c-thermostat": "c-thermostat.js"
|
||||
"thermostat": "thermostat.js"
|
||||
}
|
||||
},
|
||||
"author": "vvzvlad",
|
||||
|
26
thermostat.html
Normal file
26
thermostat.html
Normal file
@ -0,0 +1,26 @@
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('lower-case',{
|
||||
category: 'function',
|
||||
color: '#a6bbcf',
|
||||
defaults: {
|
||||
name: {value:""}
|
||||
},
|
||||
inputs: 1,
|
||||
outputs: 1,
|
||||
icon: "file.svg",
|
||||
label: function() {
|
||||
return this.name||"lower-case";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-template-name="lower-case">
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="lower-case">
|
||||
<p>A simple node that converts the message payloads into all lower-case characters</p>
|
||||
</script>
|
11
thermostat.js
Normal file
11
thermostat.js
Normal file
@ -0,0 +1,11 @@
|
||||
module.exports = function(RED) {
|
||||
function LowerCaseNode(config) {
|
||||
RED.nodes.createNode(this,config);
|
||||
var node = this;
|
||||
node.on('input', function(msg) {
|
||||
msg.payload = msg.payload.toLowerCase();
|
||||
node.send(msg);
|
||||
});
|
||||
}
|
||||
RED.nodes.registerType("lower-case",LowerCaseNode);
|
||||
}
|
Loading…
Reference in New Issue
Block a user