function uniqById(devices) {
  return devices.filter((v, i, a) => a.findIndex((t) => t.external_id === v.external_id) === i);
}
@description Remove duplicates by external_id from array.
@param {Array} devices - Array to transform.
@returns {Array} Array of unique devices.
@example
uniqById(devices);