Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324
  1. // Licensed under the MIT license, see LICENSE file.
  2. // Author: Per Malmberg (https://github.com/PerMalmberg)
  3. module.exports = function(RED) {
  4. function BDebug(config) {
  5. RED.nodes.createNode(this,config);
  6. this.config = config;
  7. var node = this;
  8. var NodeHelper = require('./NodeHelper.js');
  9. var h = new NodeHelper( node );
  10. this.on('input', function(msg) {
  11. var topic = msg.topic;
  12. var payload = msg.payload;
  13. if( topic !== undefined && payload !== undefined ) {
  14. h.DisplayStatus( h.ToBoolean( payload ) );
  15. }
  16. });
  17. h.DisplayUnkownStatus();
  18. }
  19. RED.nodes.registerType("BDebug",BDebug);
  20. }