-
Notifications
You must be signed in to change notification settings - Fork 130
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
X10 resends die with Can't call method "get_object_name" on an undefined value #138
Comments
These logs may be missing something important. I see that the stack trace was for: |
It's not easy to paste the logs here, especially because after the fact logs in print.log do not also contain stderr output. No logs were truncated before the first line. Looks like the error is related to the X10 command in the last log lines anyway, is it not? |
This looks like it has something to do with how the no_hop_increase flag functions when it encounters an X10 message or device. I don't have X10 devices so there is a good chance there is a mistake here. I will look into this. |
I looked at the code, and yes, I had the bug again, and it happened the same way:
It looks like self->setby does not work for X10 devices, and in turn causes the new hop code to crash. I can't test on demand because it only happens when X10 commands need to be resent, but this patch seems like it would at least stop the crash: --- a/lib/Insteon/Message.pm
|
--- a/lib/Insteon/Message.pm
+++ b/lib/Insteon/Message.pm
@@ -136,8 +136,10 @@ sub send
}
}
elsif (defined($$self{no_hop_increase}) && $main::Debug{insteon}){
- &main::print_log("[Insteon::BaseMessage] Hop count not increased for "
- . $self->setby->get_object_name . " because no_hop_increase flag was set.");
+ $_ = "";
+ $_ = $self->setby->get_object_name if (defined $self->setby);
+ &main::print_log("[Insteon::BaseMessage] Hop count not increased for $_"
+ ." because no_hop_increase flag was set.");
$$self{no_hop_increase} = undef;
}
} |
yeah, there is no reason to even concern ourselves with hops and X10 messages anyways. To make the mod even shorter the elsif statement can just be amended to read
or it can even read
if you like. Although, making sure setby is an Insteon::BaseObject might be preferable just in case we add some further future packet type. I am thinking of the zigbee/x10/insteon device sold by simplehome or whoever. |
The text was updated successfully, but these errors were encountered: