Always send wind even if it hasn't changed in order to update the wind rose.
} else {
my $o = gen_hash_diff($ld->{last_h}, \%h);
} else {
my $o = gen_hash_diff($ld->{last_h}, \%h);
- if ($o) {
- $o->{Dir} ||= $h{Dir};
- $o->{Wind} ||= $h{Wind};
- $o->{Dir} += 0;
- $o->{Wind} += 0;
- $s = genstr($ts, 'r', $o);
- push @last10minsr, $s;
- shift @last10minsr while @last10minsr > ($windmins * $updatepermin);
- }
- else {
- dbg "loop rec not changed" if isdbg 'chan';
- }
+ $o ||= {};
+ # we always send wind even if it hasn't changed in order to update the wind rose.
+ $o->{Dir} ||= ($h{Dir} + 0);
+ $o->{Wind} ||= ($h{Wind} + 0);
+ $s = genstr($ts, 'r', $o);
+ push @last10minsr, $s;
+ shift @last10minsr while @last10minsr > ($windmins * $updatepermin);
output_str($s, 0) if $s;
}
$ld->{last_h} = \%h;
output_str($s, 0) if $s;
}
$ld->{last_h} = \%h;