From dc4acab9431675f242a9cea7973743d28625f568 Mon Sep 17 00:00:00 2001 From: markusbloch Date: Sun, 10 Apr 2016 14:17:07 +0000 Subject: [PATCH] YAMAHA_AVR: skip check for extended input informations when not needed. git-svn-id: https://svn.fhem.de/fhem/trunk@11223 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/71_YAMAHA_AVR.pm | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/fhem/FHEM/71_YAMAHA_AVR.pm b/fhem/FHEM/71_YAMAHA_AVR.pm index f1ac405d7..c6d579ee9 100755 --- a/fhem/FHEM/71_YAMAHA_AVR.pm +++ b/fhem/FHEM/71_YAMAHA_AVR.pm @@ -772,12 +772,12 @@ YAMAHA_AVR_Set($@) } elsif($what eq "navigateListMenu") { - YAMAHA_AVR_SendCommand($hash, "<$zone>GetParam", "statusRequest", "basicStatus"); + YAMAHA_AVR_SendCommand($hash, "<$zone>GetParam", "statusRequest", "basicStatus", {options => {no_playinfo => 1}}); YAMAHA_AVR_SendCommand($hash, "<[CURRENT_INPUT_TAG]>GetParam", $what, join(" ", @a[2..$#a]), {options => {init => 1}}); } elsif($what eq "preset" and $a[2] =~ /^\d+$/ and $a[2] >= 1 and $a[2] <= 40) { - YAMAHA_AVR_SendCommand($hash, "<$zone>GetParam", "statusRequest", "basicStatus"); + YAMAHA_AVR_SendCommand($hash, "<$zone>GetParam", "statusRequest", "basicStatus", {options => {no_playinfo => 1}}); YAMAHA_AVR_SendCommand($hash, "<[CURRENT_INPUT_TAG]>".$a[2]."", $what, $a[2], {options => {can_fail => 1}}); } elsif($what eq "skip" and defined($a[2])) @@ -1425,15 +1425,23 @@ YAMAHA_AVR_ParseResponse ($$$) { $hash->{helper}{LAST_INPUT_TAG} = $hash->{helper}{CURRENT_INPUT_TAG} if(exists($hash->{helper}{CURRENT_INPUT_TAG})); $hash->{helper}{CURRENT_INPUT_TAG} = $1; - Log3 $name, 4, "YAMAHA_AVR ($name) - check for extended input informations on <$1>"; - - YAMAHA_AVR_SendCommand($hash, "<$1>GetParam", "statusRequest", "playInfo", {options => {can_fail => 1}}); - if(!exists($hash->{helper}{LAST_INPUT_TAG}) or ($hash->{helper}{LAST_INPUT_TAG} ne $hash->{helper}{CURRENT_INPUT_TAG}) or $hash->{helper}{SUPPORT_SHUFFLE_REPEAT}) + unless($options->{no_playinfo}) { - YAMAHA_AVR_SendCommand($hash, "<$1>GetParam", "statusRequest", "playRepeat", {options => {can_fail => 1}}); - YAMAHA_AVR_SendCommand($hash, "<$1>GetParam", "statusRequest", "playShuffle", {options => {can_fail => 1}}); - } + Log3 $name, 4, "YAMAHA_AVR ($name) - check for extended input informations on <$1>"; + + YAMAHA_AVR_SendCommand($hash, "<$1>GetParam", "statusRequest", "playInfo", {options => {can_fail => 1}}); + + if(!exists($hash->{helper}{LAST_INPUT_TAG}) or ($hash->{helper}{LAST_INPUT_TAG} ne $hash->{helper}{CURRENT_INPUT_TAG}) or $hash->{helper}{SUPPORT_SHUFFLE_REPEAT}) + { + YAMAHA_AVR_SendCommand($hash, "<$1>GetParam", "statusRequest", "playRepeat", {options => {can_fail => 1}}); + YAMAHA_AVR_SendCommand($hash, "<$1>GetParam", "statusRequest", "playShuffle", {options => {can_fail => 1}}); + } + } + else + { + Log3 $name, 4, "YAMAHA_AVR ($name) - skipping check for extended input informations on <$1>"; + } } else {