|
1234567891011121314151617181920212223 |
- module.exports = function(RED) {
- function Invert(config) {
- RED.nodes.createNode(this,config);
- this.config = config;
- var node = this;
- var NodeHelper = require('./NodeHelper.js');
- var h = new NodeHelper( node );
-
- this.on('input', function(msg) {
- var topic = msg.topic;
- var payload = msg.payload;
-
- if( topic !== undefined && payload !== undefined ) {
- h.SetResult( !h.ToBoolean( payload ), topic );
- }
- });
-
- h.DisplayUnkownStatus();
- }
-
-
- RED.nodes.registerType("Invert",Invert);
- }
|