From e799609823412e1422847ecb0a19c21e2b67b465 Mon Sep 17 00:00:00 2001 From: Michael Stovenour Date: Sun, 10 Feb 2013 22:16:17 -0600 Subject: [PATCH 1/2] Cleaned up some logging and renamed PLM "log links" for consistency Renamed PLM "show link table to log" as "log links" to be consistent with devices Improved the amount of information supplied by existing logging messages. Added "{devicename} completed sync links" message Changed "PLM" NACK warning so it doesn't reference burned out bulbs which only apply to "device" NACKs. --- lib/Insteon.pm | 2 +- lib/Insteon/BaseInsteon.pm | 8 +++++++- lib/Insteon_PLM.pm | 5 ++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/Insteon.pm b/lib/Insteon.pm index 3eed9057a..8a544b8c8 100755 --- a/lib/Insteon.pm +++ b/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"; $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"; diff --git a/lib/Insteon/BaseInsteon.pm b/lib/Insteon/BaseInsteon.pm index 9bf8459ba..1b99c1d56 100755 --- a/lib/Insteon/BaseInsteon.pm +++ b/lib/Insteon/BaseInsteon.pm @@ -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}; } } } @@ -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!"); } } @@ -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"); } } diff --git a/lib/Insteon_PLM.pm b/lib/Insteon_PLM.pm index d4f3d5efa..1b47a6071 100644 --- a/lib/Insteon_PLM.pm +++ b/lib/Insteon_PLM.pm @@ -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 From af63929fca453631bbb43d09271b7760c49ca6de Mon Sep 17 00:00:00 2001 From: Michael Stovenour Date: Mon, 11 Feb 2013 06:43:23 -0600 Subject: [PATCH 2/2] Cleaned up some logging and renamed PLM "log links" for consistency Second try to rename PLM "show link table to log" as "log links" to be consistent with devices --- lib/Insteon.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Insteon.pm b/lib/Insteon.pm index 8a544b8c8..c0a95854d 100755 --- a/lib/Insteon.pm +++ b/lib/Insteon.pm @@ -296,7 +296,7 @@ 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";