Skip to content

Commit

Permalink
Insteon: Catch Multiple Calls to Set_Receive in the Same Pass
Browse files Browse the repository at this point in the history
Resolves one of the three loopholes discovered by @peloy which permitted duplicate messages received in the same pass to be processed.

Hopefully the final fix for hollie#169
  • Loading branch information
krkeegan committed May 17, 2013
1 parent 40d15cd commit ea7b71e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Insteon/BaseInsteon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ sub set_receive
my ($self, $p_state, $p_setby, $p_response) = @_;
my $curr_milli = sprintf('%.0f', &main::get_tickcount);
my $window = 1000;
if ($p_state eq $self->state && ($curr_milli - $$self{set_milliseconds} < $window)){
if (($p_state eq $self->state || $p_state eq $self->state_final)
&& ($curr_milli - $$self{set_milliseconds} < $window)){
::print_log("[Insteon::BaseObject] Ignoring duplicate set " . $p_state .
" state command for " . $self->get_object_name . " received in " .
"less than $window milliseconds") if $main::Debug{insteon};
Expand Down

0 comments on commit ea7b71e

Please sign in to comment.