mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
33_readingsProxy.pm: avoid endless loops for self referencing readingsProxys
git-svn-id: https://svn.fhem.de/fhem/trunk@7650 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c1f1368725
commit
350a949839
@ -228,10 +228,16 @@ readingsProxy_Set($@)
|
||||
readingsSingleUpdate($hash, "lastCmd", $a[0], 0);
|
||||
}
|
||||
|
||||
Log3 $name, 4, "$name: set hash->{DEVICE} $v";
|
||||
return CommandSet(undef,"$hash->{DEVICE} ".$v);
|
||||
if( $hash->{INSET} ) {
|
||||
Log3 $name, 2, "$name: ERROR: endless loop detected";
|
||||
return "ERROR: endless loop detected for $hash->{NAME}";
|
||||
}
|
||||
|
||||
return undef;
|
||||
Log3 $name, 4, "$name: set hash->{DEVICE} $v";
|
||||
$hash->{INSET} = 1;
|
||||
my $ret = CommandSet(undef,"$hash->{DEVICE} ".$v);
|
||||
delete($hash->{INSET});
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub
|
||||
@ -268,10 +274,16 @@ readingsProxy_Get($@)
|
||||
$v = $get_fn if( $get_fn );
|
||||
}
|
||||
|
||||
Log3 $name, 4, "$name: get hash->{DEVICE} $v";
|
||||
return CommandGet(undef,"$hash->{DEVICE} ".$v);
|
||||
if( $hash->{INGET} ) {
|
||||
Log3 $name, 2, "$name: ERROR: endless loop detected";
|
||||
return "ERROR: endless loop detected for $hash->{NAME}";
|
||||
}
|
||||
|
||||
return undef;
|
||||
Log3 $name, 4, "$name: get hash->{DEVICE} $v";
|
||||
$hash->{INSET} = 1;
|
||||
my$ret = CommandGet(undef,"$hash->{DEVICE} ".$v);
|
||||
delete($hash->{INSET});
|
||||
return $ret;
|
||||
}
|
||||
|
||||
1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user