code: function AvrYamahaNodePut(config) {
      RED.nodes.createNode(this, config);
  
      // Save settings in local node
      this.device = config.device;
      this.deviceNode = RED.nodes.getNode(this.device);
      this.name = config.name;
      this.topic = config.topic;
      this.payload = config.payload;
  
      var node = this;
      if (this.deviceNode) {
  
    		// Input handler, called on incoming flow
    		this.on('input', function(msg) {
  
          // If no topic is given in the config, then we us the topic in the msg.
          var topic = (node.topic) ? node.topic : msg.topic;
          if (!topic) {
            node.error('No topic given. Specify either in the config or via msg.topic!');
            return;
          }
  
          // If no payload is given in the config, then we us the payload in the msg.
          var payload = (node.payload) ? node.payload : msg.payload;
          if (payload === null || payload === undefined) {
            node.error('invalid payload: ' + payload.toString());
            return;
          }
  
          // Some commands need additional payload values. These might be given as JSON object or
          // automatically added.
          var jsonPayload = tryParseJSON(payload);
          if (jsonPayload !== false) {
            payload = jsonPayload
          } else {
            // Check if this topic needs additional payload values and add them to payload
            var addPayloadFormat = references.hasAdditionalPayload(topic);
            if (addPayloadFormat) {
              payload = JSON.parse(addPayloadFormat.replace('%s', payload).trim());
            }
          }
  
          // Put data to the device.
          node.deviceNode.sendPutCommand(topic, payload).then(function(value) {
            // Continue the flow when data has been put...
            node.send(msg);
          }).catch(function(error) {
            node.error("Failed to put data to AVR with error: " + error);
          });
  
    		});
  
      } else {
        this.error(RED._("avr-yamaha.errors.missing-config"));
      }
    }
docs: /* ---------------------------------------------------------------------------
  PUT node
  -------------------------------------------------------------------------