mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-15 03:59:11 +00:00
improved on/off handling via notifications
git-svn-id: https://svn.fhem.de/fhem/trunk@6307 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
912df334cb
commit
2e7c9aac14
@ -1522,7 +1522,30 @@ sub SB_SERVER_Notify( $$ ) {
|
||||
|
||||
Log3( $hash, 4, "SB_SERVER_Notify($name): called" .
|
||||
"Own:" . $name . " Device:" . $devName );
|
||||
return( "" );
|
||||
|
||||
if( $devName eq $hash->{RCCNAME} ) {
|
||||
Log3( $hash, 1, "SB_SERVER_Notify($name): from $hash->{RCCNAME} " .
|
||||
"with " . ReadingsVal( $hash->{RCCNAME}, "state", "off" ) );
|
||||
if( ReadingsVal( $hash->{RCCNAME}, "state", "off" ) eq "off" ) {
|
||||
RemoveInternalTimer( $hash );
|
||||
InternalTimer( gettimeofday() + 10,
|
||||
"SB_SERVER_Alive",
|
||||
$hash,
|
||||
0 );
|
||||
} elsif( ReadingsVal( $hash->{RCCNAME}, "state", "off" ) eq "on" ) {
|
||||
RemoveInternalTimer( $hash );
|
||||
# do an update of the status, but SB CLI must come up
|
||||
InternalTimer( gettimeofday() + 20,
|
||||
"SB_SERVER_Alive",
|
||||
$hash,
|
||||
0 );
|
||||
} else {
|
||||
return( undef );
|
||||
}
|
||||
return( "" );
|
||||
} else {
|
||||
return( undef );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user