From 5df02152df446988ee78f0ec311ee1818acae68b Mon Sep 17 00:00:00 2001 From: markusbloch Date: Thu, 10 Jan 2013 18:52:38 +0000 Subject: [PATCH] better log message, error message only occure once git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2466 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/71_YAMAHA_AVR.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FHEM/71_YAMAHA_AVR.pm b/FHEM/71_YAMAHA_AVR.pm index a96fef40d..3a91a671e 100755 --- a/FHEM/71_YAMAHA_AVR.pm +++ b/FHEM/71_YAMAHA_AVR.pm @@ -482,7 +482,7 @@ YAMAHA_AVR_SendCommand($$;$) unless(defined($response)) { - Log GetLogLevel($name, 3), "YAMAHA_AVR: could not execute command on device $name" if (defined($hash->{helper}{AVAILABLE}) and $hash->{helper}{AVAILABLE} eq 1); + Log GetLogLevel($name, 3), "YAMAHA_AVR: could not execute command on device $name. Please turn on your device in case of deactivated network standby or check for correct hostaddress." if (defined($hash->{helper}{AVAILABLE}) and $hash->{helper}{AVAILABLE} eq 1); } else { @@ -594,7 +594,7 @@ sub YAMAHA_AVR_getModel($) $response = YAMAHA_AVR_SendCommand($hash, "GetParam"); - Log GetLogLevel($name, 3), "YAMAHA_AVR: could not get unit description url from device $name. Please turn on the device or check for correct hostaddress!" unless (defined($response)); + Log GetLogLevel($name, 3), "YAMAHA_AVR: could not get unit description url from device $name. Please turn on the device or check for correct hostaddress!" if (not defined($response) and defined($hash->{helper}{AVAILABLE}) and $hash->{helper}{AVAILABLE} eq 1); if(defined($response) and $response =~ /(.+?)<\/URL>/) @@ -608,7 +608,7 @@ sub YAMAHA_AVR_getModel($) $response = YAMAHA_AVR_SendCommand($hash, "GetParam"); - Log GetLogLevel($name, 3), "YAMAHA_AVR: could not get system configuration from device $name. Please turn on the device or check for correct hostaddress!" unless (defined($response)); + Log GetLogLevel($name, 3), "YAMAHA_AVR: could not get system configuration from device $name. Please turn on the device or check for correct hostaddress!" if (not defined($response) and defined($hash->{helper}{AVAILABLE}) and $hash->{helper}{AVAILABLE} eq 1); if(defined($response) and $response =~ /(.+?)<\/Model_Name>.*(.+?)<\/System_ID>.*(.+?)<\/Version>/) { @@ -623,7 +623,7 @@ sub YAMAHA_AVR_getModel($) $response = GetFileFromURL("http://".$address.$desc_url); - Log GetLogLevel($name, 3), "YAMAHA_AVR: could not get unit description from device $name. Please turn on the device or check for correct hostaddress!" unless (defined($response)); + Log GetLogLevel($name, 3), "YAMAHA_AVR: could not get unit description from device $name. Please turn on the device or check for correct hostaddress!" if (not defined($response) and defined($hash->{helper}{AVAILABLE}) and $hash->{helper}{AVAILABLE} eq 1); return undef unless(defined($response)); @@ -674,7 +674,7 @@ sub YAMAHA_AVR_getInputs($) my $response = YAMAHA_AVR_SendCommand($hash, "<$zone>GetParam"); - Log GetLogLevel($name, 3), "YAMAHA_AVR: could not get the available inputs from device $name. Please turn on the device or check for correct hostaddress!!!" unless (defined($response)); + Log GetLogLevel($name, 3), "YAMAHA_AVR: could not get the available inputs from device $name. Please turn on the device or check for correct hostaddress!!!" if (not defined($response) and defined($hash->{helper}{AVAILABLE}) and $hash->{helper}{AVAILABLE} eq 1); return undef unless (defined($response));