diff --git a/lib/Insteon/AllLinkDatabase.pm b/lib/Insteon/AllLinkDatabase.pm index 2759ae48c..44ca2488e 100755 --- a/lib/Insteon/AllLinkDatabase.pm +++ b/lib/Insteon/AllLinkDatabase.pm @@ -796,7 +796,7 @@ sub delete_orphan_links : &Insteon::get_object($deviceid,'01'); if (!($linked_device)) { - # no device is known by mh with the ADLB record's deviceid + # no device is known by mh with the ALDB record's deviceid if ($audit_mode) { &::print_log("[Insteon::ALDB_i1] (AUDIT) " . $selfname . " now deleting orphaned link w/ details: " @@ -1212,16 +1212,16 @@ sub add_duplicate_link_address unshift @{$$self{aldb}{duplicates}}, $address; # now, keep the list sorted! - @{$$self{adlb}{duplicates}} = sort(@{$$self{aldb}{duplicates}}); + @{$$self{aldb}{duplicates}} = sort(@{$$self{aldb}{duplicates}}); } sub delete_duplicate_link_address { my ($self, $address) = @_; - my $num_duplicate_link_addresses = 0; - - $num_duplicate_link_addresses = @{$$self{aldb}{duplicates}} if (defined $$self{aldb}{duplicates}); + my $num_duplicate_link_addresses = 0; + + $num_duplicate_link_addresses = @{$$self{aldb}{duplicates}} if (defined $$self{aldb}{duplicates}); if ($num_duplicate_link_addresses) { my @temp_duplicates = (); @@ -1241,8 +1241,8 @@ sub add_empty_address { my ($self, $address) = @_; # before adding it, make sure that it isn't already in the list!! - my $num_addresses = 0; - $num_addresses = @{$$self{aldb}{empty}} if (defined $$self{aldb}{empty}); + my $num_addresses = 0; + $num_addresses = @{$$self{aldb}{empty}} if (defined $$self{aldb}{empty}); my $exists = 0; if ($num_addresses and $address) { @@ -1262,7 +1262,7 @@ sub add_empty_address } # now, keep the list sorted! - @{$$self{adlb}{empty}} = sort(@{$$self{aldb}{empty}}); + @{$$self{aldb}{empty}} = sort(@{$$self{aldb}{empty}}); } @@ -1298,7 +1298,7 @@ sub get_first_empty_address $low_address = $new_address if $new_address < $low_address; } } - $first_address = sprintf('%04X', $low_address - 8); + $first_address = ($low_address > 0) ? sprintf('%04X', $low_address - 8) : 0; } return $first_address; diff --git a/lib/Insteon/BaseInsteon.pm b/lib/Insteon/BaseInsteon.pm index 6e7e34ee1..711404983 100755 --- a/lib/Insteon/BaseInsteon.pm +++ b/lib/Insteon/BaseInsteon.pm @@ -530,7 +530,7 @@ sub _process_message . $self->get_nack_msg_for( $msg{extra} ) .") for " . $self->{object_name} - . ". It may be unplugged or have a burned out bulb") if $main::Debug{insteon}; + . ". It may be unplugged or have a burned out bulb or this may be a new I2CS type device.") if $main::Debug{insteon}; } else { &::print_log("[Insteon::BaseObject] WARN!! encountered a nack message ("