2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

set does not return a value any more

made state setting compliant with guidelines

git-svn-id: https://svn.fhem.de/fhem/trunk@2572 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2013-01-26 21:46:29 +00:00
parent 791aad4425
commit d06a6d9897

View File

@ -95,15 +95,21 @@ sub
ECMDDevice_Changed($$$) ECMDDevice_Changed($$$)
{ {
my ($hash, $cmd, $value)= @_; my ($hash, $cmd, $value)= @_;
readingsSingleUpdate($hash, $cmd, $value, 1); readingsBeginUpdate($hash);
readingsBulkUpdate($hash, $cmd, $value, 1) if(defined($value));
$hash->{STATE} = "$cmd $value"; my $state= $cmd;
$state.= " $value" if(defined($value));
readingsBulkUpdate($hash, "state", $state, 0);
readingsEndUpdate($hash, 1);
my $name= $hash->{NAME}; my $name= $hash->{NAME};
Log GetLogLevel($name, 4), "ECMDDevice $name $cmd: $value"; Log GetLogLevel($name, 4), "ECMDDevice $name $state";
return $hash->{STATE}; return $state;
} }
@ -220,9 +226,8 @@ ECMDDevice_Set($@)
$v= ECMDDevice_PostProc($hash, $postproc, $v); $v= ECMDDevice_PostProc($hash, $postproc, $v);
# $v= join(" ", @a) if($params); ECMDDevice_Changed($hash, $cmdname, $v); # was: return ECMDDevice_Changed($hash, $cmdname, $v);
return undef;
return ECMDDevice_Changed($hash, $cmdname, $v);
} }