lib/parsePacket.js
function parsePacket(packet) {
  var parsedPacket = loopPacket.parse(packet);
  var convertedPacket = {};
  for(var property in parsedPacket) {
    var value = parsedPacket[property];
    switch (property){
      case "BarTrend":
        value = _convertBarTrend(value);
        break;
      case "TempIn":
      case "TempOut":
        value = Convert(value/10).from('F').to('C');
        break;
      case "BatteryVolts":
	value = _convertToVoltage(value);
	break;	
      case "ForecastRuleNo":
	value = _getForecastString(value);
	break;
      case "ForecastIcon":
	value = _parseIconValue(value);
	break;
      case "SunRise":
      case "SunSet":
	value = _convertTime(value);
        break;
      case "WindSpeed":
      case "WindSpeed10Min":
	value = Convert(value).from('m/h').to('m/s');
	break;
	
    }
    convertedPacket[property] = value;

  }

  return parsedPacket;
}
function parsePacket(packet) {
  var parsedPacket = loopPacket.parse(packet);
  var convertedPacket = {};
  for(var property in parsedPacket) {
    var value = parsedPacket[property];
    switch (property){
      case "BarTrend":
        value = _convertBarTrend(value);
        break;
      case "TempIn":
      case "TempOut":
        value = Convert(value/10).from('F').to('C');
        break;
      case "BatteryVolts":
	value = _convertToVoltage(value);
	break;	
      case "ForecastRuleNo":
	value = _getForecastString(value);
	break;
      case "ForecastIcon":
	value = _parseIconValue(value);
	break;
      case "SunRise":
      case "SunSet":
	value = _convertTime(value);
        break;
      case "WindSpeed":
      case "WindSpeed10Min":
	value = Convert(value).from('m/h').to('m/s');
	break;
	
    }
    convertedPacket[property] = value;

  }

  return parsedPacket;
}
function parsePacket ( packet ) { var parsedPacket = loopPacket . parse ( packet ) ; var convertedPacket = { } ; for ( var property in parsedPacket ) { var value = parsedPacket [ property ] ; switch ( property ) { case "BarTrend" : value = _convertBarTrend ( value ) ; break ; case "TempIn" : case "TempOut" : value = Convert ( value / 10 ) . from ( 'F' ) . to ( 'C' ) ; break ; case "BatteryVolts" : value = _convertToVoltage ( value ) ; break ; case "ForecastRuleNo" : value = _getForecastString ( value ) ; break ; case "ForecastIcon" : value = _parseIconValue ( value ) ; break ; case "SunRise" : case "SunSet" : value = _convertTime ( value ) ; break ; case "WindSpeed" : case "WindSpeed10Min" : value = Convert ( value ) . from ( 'm/h' ) . to ( 'm/s' ) ; break ; } convertedPacket [ property ] = value ; } return parsedPacket ; }
Parse Davis Packet

@param packet
Parse Davis Packet