message: fix: Buffer support on write requests
diff: @@ -398,6 +398,7 @@ function getMappedValues (valueId, modeMap, integerList) {
  * based on the type of the payload and the gateway config
  */
  Gateway.prototype.parsePayload = function (payload, valueId, valueConf) {
  + try {
  payload = payload.hasOwnProperty('value') ? payload.value : payload
  // Hass payload parsing
  @@ -439,6 +440,14 @@ Gateway.prototype.parsePayload = function (payload, valueId, valueConf) {
  payload = valueId.values[payload]
  }
  + if (valueId.type === 'raw') {
  + if (payload.type === 'Buffer' && payload.data) {
  + payload = Buffer.from(payload.data)
  + } else {
  + payload = Buffer.from(payload)
  + }
  + }
  +
  if (valueConf && isValidOperation(valueConf.postOperation)) {
  var op = valueConf.postOperation
  @@ -447,6 +456,9 @@ Gateway.prototype.parsePayload = function (payload, valueId, valueConf) {
  payload = eval(payload + op)
  }
  + } catch (error) {
  + debug('Error while parsing payload', payload, 'for valueID', valueId)
  + }
  return payload
  }
  