function toTemperature(bits) {
  var data = parseInt(bits, 16);
  if(data > 2047) {
    return (data - 4096) / 16;
  }
  return data / 16;
}
/**
 * Convert the given bytes to temperature.
 * @param {String} bits The 12 bits of the encoded temperature.
 */
Convert the given bytes to temperature.
@param {String} bits The 12 bits of the encoded temperature.
Convert the given bytes to temperature . @param { String } bits The 12 bits of the encoded temperature .
function toTemperature(bits) {
  var data = parseInt(bits, 16);
  if(data > 2047) {
    return (data - 4096) / 16;
  }
  return data / 16;
}
function toTemperature ( bits ) { var data = parseInt ( bits , 16 ) ; if ( data > 2047 ) { return ( data - 4096 ) / 16 ; } return data / 16 ; }
Convert the given bytes to temperature.
Convert the given bytes to temperature .