mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
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
This commit is contained in:
parent
f42aa89b0e
commit
1d5b4bfb90
@ -321,14 +321,15 @@ sub ONKYO_AVR_Notify($$) {
|
|||||||
foreach my $change ( @{ $dev->{CHANGED} } ) {
|
foreach my $change ( @{ $dev->{CHANGED} } ) {
|
||||||
|
|
||||||
# DISCONNECTED
|
# DISCONNECTED
|
||||||
if ( $change eq "DISCONNECTED" && $presence ne "absent" ) {
|
if ( $change eq "DISCONNECTED" ) {
|
||||||
Log3 $hash, 5, "ONKYO_AVR " . $name . ": processing change $change";
|
Log3 $hash, 5, "ONKYO_AVR " . $name . ": processing change $change";
|
||||||
|
|
||||||
# disable connectionCheck and wait
|
# disable connectionCheck and wait
|
||||||
# until DevIo reopened the connection
|
# until DevIo reopened the connection
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
|
|
||||||
readingsBulkUpdate( $hash, "presence", "absent" );
|
readingsBulkUpdate( $hash, "presence", "absent" )
|
||||||
|
if ( $presence ne "absent" );
|
||||||
|
|
||||||
readingsBulkUpdate( $hash, "power", "off" )
|
readingsBulkUpdate( $hash, "power", "off" )
|
||||||
if ( ReadingsVal( $name, "power", "on" ) ne "off" );
|
if ( ReadingsVal( $name, "power", "on" ) ne "off" );
|
||||||
@ -354,10 +355,11 @@ sub ONKYO_AVR_Notify($$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# CONNECTED
|
# CONNECTED
|
||||||
elsif ( $change eq "CONNECTED" && $presence ne "present" ) {
|
elsif ( $change eq "CONNECTED" ) {
|
||||||
Log3 $hash, 5, "ONKYO_AVR " . $name . ": processing change $change";
|
Log3 $hash, 5, "ONKYO_AVR " . $name . ": processing change $change";
|
||||||
|
|
||||||
readingsBulkUpdate( $hash, "presence", "present" );
|
readingsBulkUpdate( $hash, "presence", "present" )
|
||||||
|
if ( $presence ne "present" );
|
||||||
|
|
||||||
# stateAV
|
# stateAV
|
||||||
my $stateAV = ONKYO_AVR_GetStateAV($hash);
|
my $stateAV = ONKYO_AVR_GetStateAV($hash);
|
||||||
@ -1977,6 +1979,9 @@ sub ONKYO_AVR_Set($$$) {
|
|||||||
$channels_txt =~ s/\s/_/g;
|
$channels_txt =~ s/\s/_/g;
|
||||||
$channels_txt = substr( $channels_txt, 0, -1 );
|
$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
|
# for each reading, check if there is a known command for it
|
||||||
# and allow to set values if there are any available
|
# and allow to set values if there are any available
|
||||||
|
Loading…
x
Reference in New Issue
Block a user