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 Delete Orphan Links Errors #28

Closed
krkeegan opened this issue Dec 20, 2012 · 1 comment
Closed

Insteon Delete Orphan Links Errors #28

krkeegan opened this issue Dec 20, 2012 · 1 comment
Labels

Comments

@krkeegan
Copy link
Collaborator

Dustin Robinson reported the following error:

tie_events eval error: Can't locate object method "device_id" via package "Insteon::ALDB_PLM" at /opt/misterhouse/mh/bin/../lib/Insteon/AllLinkDatabase.pm line 718.


Marc Merlin reported another error:

Similar (but not idential problem) here on delete orphans:
19/12/2012 18:30:24 [Insteon_PLM] DEBUG3: Received raw PLM data: 026207de8b0f2be806
19/12/2012 18:30:24 [Insteon_PLM] DEBUG3: Received PLM acknowledge: obj=$gar_outlights_kpl; command=peek; extra=E8
19/12/2012 18:30:24 [Insteon_PLM] DEBUG3: Received raw PLM data: 025007de8b18d4ce232ba2
Can't use an undefined value as an ARRAY reference at ../lib/Insteon/AllLinkDatabase.pm line 1240.
mh stopped, enter to restart

Here's the patch I had to write for mine. You may need to write a similar
patch for your problem.

--- mh/lib/Insteon/AllLinkDatabase.pm.orig      2012-12-19 18:35:22.259809914 -0800
+++ mh/lib/Insteon/AllLinkDatabase.pm   2012-12-19 18:40:50.003238952 -0800
@@ -1217,7 +1217,9 @@
 sub delete_duplicate_link_address
 {
        my ($self, $address) = @_;
-        my $num_duplicate_link_addresses = @{$$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 = ();
@@ -1237,7 +1239,8 @@
 {
        my ($self, $address) = @_;
         # before adding it, make sure that it isn't already in the list!!
-        my $num_addresses = @{$$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)
         {

Note that this code is not bullet proof, Gregg wrote a lot of it quicky when
I was reporting bugs to him just before he had to stop contributing.

Marc


Found a typo on line 1262:

@{$$self{adlb}{empty}} = sort(@{$$self{aldb}{empty}});
^aldb

Similar error appears on 1215

krkeegan referenced this issue in krkeegan/misterhouse Dec 21, 2012
Based on Marc Merlin's code, I confirmed that I received the same error.  More issues with #28 still need to be solved.
@krkeegan
Copy link
Collaborator Author

Only Dustin's issue remains outstanding and I can't reproduce it.

hplato added a commit that referenced this issue Aug 31, 2024
Override set_label and set_states Reload restriction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant