From 57780a7c38d11f0ae564c96482a25b7d3cfd3b6e Mon Sep 17 00:00:00 2001 From: markusbloch Date: Fri, 12 Jul 2013 18:52:28 +0000 Subject: [PATCH] fixing crash of FHEM when longpoll is activated git-svn-id: https://svn.fhem.de/fhem/trunk@3409 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/71_YAMAHA_AVR.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/71_YAMAHA_AVR.pm b/fhem/FHEM/71_YAMAHA_AVR.pm index dbfe80f5e..cb874c178 100755 --- a/fhem/FHEM/71_YAMAHA_AVR.pm +++ b/fhem/FHEM/71_YAMAHA_AVR.pm @@ -207,11 +207,10 @@ YAMAHA_AVR_Set($@) return "No Argument given" if(!defined($a[1])); - + my $what = $a[1]; my $usage = "Unknown argument $what, choose one of on off volume:slider,-80,1,16 input:".$inputs_comma." mute:on,off remoteControl:setup,up,down,left,right,return,option,display,enter scene:".$scenes_comma." statusRequest"; - readingsBeginUpdate($hash); if($what eq "on") { @@ -220,8 +219,10 @@ YAMAHA_AVR_Set($@) if($result =~ /RC="0"/ and $result =~ /<\/Power>/) { # As the receiver startup takes about 5 seconds, the status will be already set, if the return code of the command is 0. + readingsBeginUpdate($hash); readingsBulkUpdate($hash, "power", "on"); readingsBulkUpdate($hash, "state","on"); + readingsEndUpdate($hash, 1); return undef; } else @@ -465,7 +466,6 @@ YAMAHA_AVR_Set($@) { return $usage; } - readingsEndUpdate($hash, 1); # Call the GetStatus() Function to retrieve the new values after setting something (with local flag, so the internal timer is not getting interupted) YAMAHA_AVR_GetStatus($hash, 1);