From aaa2cdcfeb638739ac7f92bceaec78d6b817a24f Mon Sep 17 00:00:00 2001 From: loredo Date: Sun, 2 Oct 2016 20:49:46 +0000 Subject: [PATCH] 70_ONKYO_AVR.pm: fix reading configuration after fhem restart (Forum #15024) git-svn-id: https://svn.fhem.de/fhem/trunk@12247 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/70_ONKYO_AVR.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/70_ONKYO_AVR.pm b/fhem/FHEM/70_ONKYO_AVR.pm index 297fb45b7..57b6f41b7 100644 --- a/fhem/FHEM/70_ONKYO_AVR.pm +++ b/fhem/FHEM/70_ONKYO_AVR.pm @@ -321,14 +321,15 @@ sub ONKYO_AVR_Notify($$) { foreach my $change ( @{ $dev->{CHANGED} } ) { # DISCONNECTED - if ( $change eq "DISCONNECTED" && $presence ne "absent" ) { + if ( $change eq "DISCONNECTED" ) { Log3 $hash, 5, "ONKYO_AVR " . $name . ": processing change $change"; # disable connectionCheck and wait # until DevIo reopened the connection RemoveInternalTimer($hash); - readingsBulkUpdate( $hash, "presence", "absent" ); + readingsBulkUpdate( $hash, "presence", "absent" ) + if ( $presence ne "absent" ); readingsBulkUpdate( $hash, "power", "off" ) if ( ReadingsVal( $name, "power", "on" ) ne "off" ); @@ -354,10 +355,11 @@ sub ONKYO_AVR_Notify($$) { } # CONNECTED - elsif ( $change eq "CONNECTED" && $presence ne "present" ) { + elsif ( $change eq "CONNECTED" ) { Log3 $hash, 5, "ONKYO_AVR " . $name . ": processing change $change"; - readingsBulkUpdate( $hash, "presence", "present" ); + readingsBulkUpdate( $hash, "presence", "present" ) + if ( $presence ne "present" ); # stateAV my $stateAV = ONKYO_AVR_GetStateAV($hash); @@ -1977,6 +1979,9 @@ sub ONKYO_AVR_Set($$$) { $channels_txt =~ s/\s/_/g; $channels_txt = substr( $channels_txt, 0, -1 ); } + else { + $channels_txt = ReadingsVal( $name, "channelList", "" ); + } # for each reading, check if there is a known command for it # and allow to set values if there are any available