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

Cleaned up some logging and renamed PLM "log links" for consistency #71

Merged
merged 2 commits into from
Feb 16, 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.pm
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ sub generate_voice_commands
$object_string .= &main::store_object_data($object_name_v, 'Voice_Cmd', 'Insteon', 'Insteon_item_commands');
push @_insteon_device, $object_name if $group eq '01'; # don't allow non-base items to participate
} elsif ($object->isa('Insteon_PLM')) {
my $cmd_states = "complete linking as responder,cancel linking,delete link with PLM,scan link table,show link table to log,delete orphan links,AUDIT - delete orphan links,scan all device link tables,sync all links,AUDIT - sync all links";
my $cmd_states = "complete linking as responder,cancel linking,delete link with PLM,scan link table,log links,delete orphan links,AUDIT - delete orphan links,scan all device link tables,sync all links,AUDIT - sync all links";
$object_string .= "$object_name_v = new Voice_Cmd '$command [$cmd_states]';\n";
$object_string .= "$object_name_v -> tie_event('$object_name->complete_linking_as_responder','complete linking as responder');\n\n";
$object_string .= "$object_name_v -> tie_event('$object_name->initiate_unlinking_as_controller','initiate unlinking');\n\n";
$object_string .= "$object_name_v -> tie_event('$object_name->cancel_linking','cancel linking');\n\n";
$object_string .= "$object_name_v -> tie_event('$object_name->log_alllink_table','show link table to log');\n\n";
$object_string .= "$object_name_v -> tie_event('$object_name->log_alllink_table','log links');\n\n";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you need to change the cmd_state on line 299 as well in order for this to work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. This shows a flaw in my work flow. I omitted a change that I consider part of i2CS dev where I added a new command. I didn’t realize that I was omitting the renaming of that command as well.

From: krkeegan [mailto:notifications@github.com]
Sent: Monday, February 11, 2013 12:01 AM
To: hollie/misterhouse
Cc: Michael Stovenour
Subject: Re: [misterhouse] Cleaned up some logging and renamed PLM "log links" for consistency (#71)

In lib/Insteon.pm:

@@ -301,7 +301,7 @@ sub generate_voice_commands
$object_string .= "$object_name_v -> tie_event('$object_name->complete_linking_as_responder','complete linking as responder');\n\n";
$object_string .= "$object_name_v -> tie_event('$object_name->initiate_unlinking_as_controller','initiate unlinking');\n\n";
$object_string .= "$object_name_v -> tie_event('$object_name->cancel_linking','cancel linking');\n\n";

  •       $object_string .= "$object_name_v -> tie_event('$object_name->log_alllink_table','show link table to log');\n\n";
    
  •       $object_string .= "$object_name_v -> tie_event('$object_name->log_alllink_table','log links');\n\n";
    

I think you need to change the cmd_state on line 299 as well in order for this to work.


Reply to this email directly or view it on GitHub https://github.com/hollie/misterhouse/pull/71/files#r2957530 ..

https://github.com/notifications/beacon/Nvoh7bM6g31WX2NN_lw41aw6CQu8FlPOA0Yz7ZizF67PUMyIBvwKheDfowXkGvVK.gif

$object_string .= "$object_name_v -> tie_event('$object_name->scan_link_table(\"" . '\$self->log_alllink_table' . "\")','scan link table');\n\n";
$object_string .= "$object_name_v -> tie_event('$object_name->delete_orphan_links','delete orphan links');\n\n";
$object_string .= "$object_name_v -> tie_event('$object_name->delete_orphan_links(1)','AUDIT - delete orphan links');\n\n";
Expand Down
8 changes: 7 additions & 1 deletion lib/Insteon/BaseInsteon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,9 @@ sub _process_message
$self->set($p_state, $self); # unless (lc($self->state) eq lc($p_state)) and
# ($msg{type} eq 'cleanup' and $$self{_pending_cleanup});
$$self{_pending_cleanup} = 0;
} else {
main::print_log("[Insteon::BaseObject] Ignoring unsupported command from "
. $self->{object_name}) if $main::Debug{insteon};
}
}
}
Expand Down Expand Up @@ -1268,7 +1271,8 @@ sub add
$ramp_rate =~ s/s$//i;
$$self{members}{$obj}{ramp_rate} = $ramp_rate if defined $ramp_rate;
} else {
&::print_log("[Insteon::BaseController] WARN: unable to add $obj as items of this type are not supported!");
&::print_log("[Insteon::BaseController] WARN: unable to add ".$obj->{device_id}.":".$obj->{m_group}
." as items of type ".ref($obj)." are not supported!");
}
}

Expand Down Expand Up @@ -1507,6 +1511,8 @@ sub _process_sync_queue {
if $@ and $main::Debug{insteon};
$$self{sync_queue_callback} = undef;
package Insteon::Insteon_link;
} else {
main::print_log($self->get_object_name." completed sync links");
}
}

Expand Down
5 changes: 2 additions & 3 deletions lib/Insteon_PLM.pm
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,8 @@ sub _parse_data {
}
else
{
&::print_log("[Insteon_PLM] WARN: received NACK for "
. $pending_message->to_string()
. ". If this is a light fixture, check bulb");
&::print_log("[Insteon_PLM] WARN: received NACK from PLM for "
. $pending_message->to_string());
}
}
else
Expand Down