Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insteon: Reset ALDB Scan Time on Completed Successful Scan Only #276

Merged
merged 1 commit into from
Oct 12, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Insteon/AllLinkDatabase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ sub query_aldb_delta
#if we just did a aldb_query less than 2 seconds ago, don't repeat
&::print_log("[Insteon::AllLinkDatabase] The link table for "
. $self->{device}->get_object_name . " is in sync.");
#Further extend Scan Time in case of serial aldb requests
$self->scandatetime(&main::get_tickcount);
if (defined $self->{_aldb_unchanged_callback}) {
package main;
my $callback = $self->{_aldb_unchanged_callback};
Expand Down Expand Up @@ -288,7 +290,6 @@ sub scan_link_table
$$self{_mem_activity} = 'scan';
$$self{_success_callback} = ($success_callback) ? $success_callback : undef;
$$self{_failure_callback} = ($failure_callback) ? $failure_callback : undef;
$self->scandatetime(&main::get_tickcount);
$self->health('out-of-sync'); # allow acknowledge to set otherwise
if($self->isa('Insteon::ALDB_i1')) {
$self->_peek('0FF8',0);
Expand Down Expand Up @@ -2715,7 +2716,6 @@ Sends the request for the first alllink entry on the PLM.
sub get_first_alllink
{
my ($self) = @_;
$self->scandatetime(&main::get_tickcount);
$self->health('out-of-sync'); # set as corrupt and allow acknowledge to set otherwise
$$self{device}->queue_message(new Insteon::InsteonMessage('all_link_first_rec', $$self{device}));
}
Expand Down
2 changes: 2 additions & 0 deletions lib/Insteon/BaseInsteon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ sub _is_info_request
if ($self->_aldb->aldb_delta() eq $msg{cmd_code}){
&::print_log("[Insteon::BaseObject] The link table for "
. $self->{object_name} . " is in sync.");
#Link Table Scan Successful, Record Current Time
$self->_aldb->scandatetime(&main::get_tickcount);
if (defined $self->_aldb->{_aldb_unchanged_callback}) {
$callback = $self->_aldb->{_aldb_unchanged_callback};
$self->_aldb->{_aldb_unchanged_callback} = undef;
Expand Down
1 change: 1 addition & 0 deletions lib/Insteon_PLM.pm
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ sub _parse_data {
{
$self->_aldb->health("good");
}
$self->_aldb->scandatetime(&main::get_tickcount);
&::print_log("[Insteon_PLM] " . $self->get_object_name
. " completed link memory scan: status: " . $self->_aldb->health())
if $main::Debug{insteon};
Expand Down