Skip to content

Commit

Permalink
Fix for Issue #26
Browse files Browse the repository at this point in the history
Previously, insteon cleanup messages received by MH, would cause MH to clear the active message
withoug confirming if the cleanup message corresponded to the active message.

If multiple PLM scenes were sent sequentially, a cleanup message from one scene may have caused
MH to clear out the following scenes command.

This patch only clears the active message if the cleanup message matches the active message.
  • Loading branch information
krkeegan committed Dec 20, 2012
1 parent ed0037d commit 253afad
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/Insteon/BaseInterface.pm
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,20 @@ sub on_standard_insteon_received
$self->transmit_in_progress(1);
# ask the object to process the received message and update its state
$object->_process_message($self, %cleanup_msg);
$self->clear_active_message();
# Only clear active message if the cleanup received is really meant for the active message
if (($msg{extra} == $self->active_message->setby->group)
&& ($object->message_type($msg{cmd_code}) eq $self->active_message->command)){
$self->clear_active_message();
&main::print_log("[Insteon::BaseInterface] DEBUG3: Cleanup message received, "
. "matched active message, cleared the active message") if $main::Debug{insteon} >= 3;
}
else {
&main::print_log("[Insteon::BaseInterface] DEBUG3: Cleanup message received, but "
. "active message not cleared b/c group/command in recent message "
. $msg{extra}."/".$object->message_type($msg{cmd_code}). " did not match group in "
. "prior sent message group/command " . $self->active_message->setby->group
."/".$self->active_message->command) if $main::Debug{insteon} >= 3;
}
}
else
{
Expand Down Expand Up @@ -512,4 +525,4 @@ sub _aldb
}


1
1

0 comments on commit 253afad

Please sign in to comment.