Skip to content

Commit

Permalink
Insteon_Diags: Make Sure Setby is an Object
Browse files Browse the repository at this point in the history
Fix bug identified by @JaredF
  • Loading branch information
krkeegan committed Aug 13, 2013
1 parent 75a33ab commit 2d998fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Insteon/Message.pm
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ sub send
&::print_log("[Insteon::BaseMessage] WARN: now resending "
. $self->to_string() . " after " . $self->send_attempts
. " attempts.") if $main::Debug{insteon};
$self->setby->retry_count_log(1) if $self->setby->can('retry_count_log');
# revise default hop count to reflect retries
if (ref $self->setby && $self->setby->isa('Insteon::BaseObject')
&& !defined($$self{no_hop_increase}))
{
$self->setby->retry_count_log(1) if $self->setby->can('retry_count_log');
if ($self->setby->default_hop_count < 3)
{
$self->setby->default_hop_count($self->setby->default_hop_count + 1);
Expand All @@ -238,7 +238,7 @@ sub send
}

# need to set timeout as a function of retries; also need to alter hop count
if ($self->send_attempts <= 0) {
if ($self->send_attempts <= 0 && ref $self->setby) {
$self->setby->outgoing_count_log(1) if $self->setby->can('outgoing_count_log');
$self->setby->outgoing_hop_count($self->setby->default_hop_count)
if $self->setby->can('outgoing_hop_count');
Expand Down

3 comments on commit 2d998fd

@JaredF
Copy link

@JaredF JaredF commented on 2d998fd Aug 13, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing that the fix for this was required because I was defining a simple string for "setby," should manually-declared "setby" parameters generally be an object instead of a string? If so, this looks like it was more an error in my coding rather than a bug.

@krkeegan
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, setby parameters can be strings within MH. It is a little bit sloppy, but that is how it is.

@JaredF
Copy link

@JaredF JaredF commented on 2d998fd Aug 13, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification and the fix!

Please sign in to comment.