mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-25 15:59:21 +00:00
ECMDDevice: commands set and get set states no matter if there is a value for set or get given
git-svn-id: https://svn.fhem.de/fhem/trunk@5645 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
0e9ca5c91a
commit
8c88b0cff7
@ -109,22 +109,18 @@ ECMDDevice_Changed($$$)
|
||||
{
|
||||
my ($hash, $cmd, $value)= @_;
|
||||
|
||||
readingsBeginUpdate($hash);
|
||||
my $state= $cmd;
|
||||
|
||||
if(defined($value) && $value ne "") {
|
||||
readingsBeginUpdate($hash);
|
||||
readingsBulkUpdate($hash, $cmd, $value);
|
||||
|
||||
my $state= $cmd;
|
||||
$state.= " $value";
|
||||
readingsBulkUpdate($hash, "state", $state);
|
||||
|
||||
readingsEndUpdate($hash, 1);
|
||||
|
||||
my $name= $hash->{NAME};
|
||||
Log3 $hash, 4 , "ECMDDevice $name $state";
|
||||
|
||||
return $state;
|
||||
}
|
||||
|
||||
readingsBulkUpdate($hash, "state", $state);
|
||||
readingsEndUpdate($hash, 1);
|
||||
my $name= $hash->{NAME};
|
||||
Log3 $hash, 4 , "ECMDDevice $name $state";
|
||||
return $state;
|
||||
}
|
||||
|
||||
###################################
|
||||
|
Loading…
x
Reference in New Issue
Block a user