Skip to content

Commit

Permalink
Merge pull request #15 from marcmerlin/branch_merge_phase2
Browse files Browse the repository at this point in the history
By Brian Paulsen <[email protected]>
  • Loading branch information
marcmerlin committed Nov 24, 2012
2 parents f2eab00 + 5079cff commit 93de5e5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/mh
Original file line number Diff line number Diff line change
Expand Up @@ -4160,6 +4160,22 @@ sub process_serial_data {

return;
}
# By Brian Paulsen <[email protected]>
# This fixes some incomplete codes like: XB3: but1_1 manual
# You can receive a unit code and a house code with no command followed by a house
# code with no unit code and then the status.
# Combine the two messages to successfully infer the status.
elsif ($event_data1 =~ /STATUS/) {
&print_log("ed1:" . $event_data1 . " prev_units : " . join(",", keys %prev_x10_units));

# new code here
if ( $event_data1 !~ /(\S\S)STATUS_(\S+)/ ) {
my @keys = keys %prev_x10_units;
my ( $data ) = $event_data1 =~ /(STATUS_\S+)/;
$event_data1 = $keys[0] . $data;
%prev_x10_units = ();
}
}
elsif ($event_data1 =~ /&P/) {
my ($house, $device, $house2, $level) = $event_data1 =~ /(\S)(\S)(\S)&P(.*)/;
$level -= 128 if ($level > 128); #***move this to cm11 module
Expand Down

0 comments on commit 93de5e5

Please sign in to comment.