mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +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/fhem@5645 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
35d776617c
commit
db7d993b46
@ -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