node-red-contrib-rn-combine.../thermostat.js

12 lines
334 B
JavaScript
Raw Normal View History

2023-10-02 21:33:26 +03:00
module.exports = function(RED) {
2023-10-02 22:32:55 +03:00
function thermostat(config) {
2023-10-02 21:33:26 +03:00
RED.nodes.createNode(this,config);
var node = this;
node.on('input', function(msg) {
2023-10-02 22:32:55 +03:00
msg.payload = msg.payload.toUpperCase();
2023-10-02 21:33:26 +03:00
node.send(msg);
});
}
2023-10-02 22:53:03 +03:00
RED.nodes.registerType("c-thermostat", thermostat );
2023-10-02 21:33:26 +03:00
}