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.

22 lines
537B

  1. module.exports = function(RED) {
  2. function BDebug(config) {
  3. RED.nodes.createNode(this,config);
  4. this.config = config;
  5. var node = this;
  6. var NodeHelper = require('./NodeHelper.js');
  7. var h = new NodeHelper( node );
  8. this.on('input', function(msg) {
  9. var topic = msg.topic;
  10. var payload = msg.payload;
  11. if( topic !== undefined && payload !== undefined ) {
  12. h.DisplayStatus( h.ToBoolean( payload ) );
  13. }
  14. });
  15. h.DisplayUnkownStatus();
  16. }
  17. RED.nodes.registerType("BDebug",BDebug);
  18. }