Ticket #5239: badtemps.diff

File badtemps.diff, 1.2 KB (added by knightr@…, 13 years ago)

patch to correct the temperature problem

  • ENVCANParser.pm

     
    1111use POSIX;
    1212use XML::Simple;
    1313
    14 our $VERSION = 0.3;
     14our $VERSION = 0.4;
    1515
    1616my %results;
    1717my %directions = (  N  => "North",      NNE => "North Northeast",
     
    137137            $results{"date-$i"} = $day;
    138138            $results{"icon-$i"} = getIcon($condition);
    139139
    140             if ($high_low =~ /high (\w*) (\d*)/i) {
     140            if ($high_low =~ /high ([a-z]*)\s?(\d*)/i) {
    141141                $temp = $2;
    142142                if ($1 =~ /minus/i) { $temp = ($temp * -1); }
    143143                $results{"high-$i"} = $temp;
    144144            }
    145145
    146             if ($high_low =~ /steady near (\w*) (\d*)/i) {
     146            if ($high_low =~ /steady near ([a-z]*)\s?(\d*)/i) {
    147147                $temp = $2;
    148148                if ($1 =~ /minus/i) { $temp = ($temp * -1); }
    149149                $results{"high-$i"} = $temp;
    150150            }
    151151
    152             if ($high_low =~ /low (\w*) (\d*)/i) {
     152            if ($high_low =~ /low ([a-z]*)\s?(\d*)/i) {
    153153                $temp = $2;
    154154                if ($1    =~ /minus/i) { $temp = ($temp * -1); }
    155155                $results{"low-$i"} = $temp;