mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
set commands will report the events translated with eventMap.
git-svn-id: https://svn.fhem.de/fhem/trunk@2752 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
6db7c6967c
commit
a64c6d2c28
21
fhem/fhem.pl
21
fhem/fhem.pl
@ -1142,12 +1142,13 @@ DoSet(@)
|
|||||||
my ($ret, $skipTrigger) = CallFn($dev, "SetFn", $hash, @a);
|
my ($ret, $skipTrigger) = CallFn($dev, "SetFn", $hash, @a);
|
||||||
return $ret if($ret);
|
return $ret if($ret);
|
||||||
return undef if($skipTrigger);
|
return undef if($skipTrigger);
|
||||||
shift @a;
|
|
||||||
|
|
||||||
# Backward compatibility. Use readingsUpdate in SetFn now
|
# Backward compatibility. Use readingsUpdate in SetFn now
|
||||||
if(!$doTriggerCalled) {
|
if(!$doTriggerCalled) {
|
||||||
|
shift @a;
|
||||||
|
# set arg if the module did not triggered events
|
||||||
my $arg = join(" ", @a) if(!$hash->{CHANGED} || !int(@{$hash->{CHANGED}}));
|
my $arg = join(" ", @a) if(!$hash->{CHANGED} || !int(@{$hash->{CHANGED}}));
|
||||||
DoTrigger($dev, $arg, 1);
|
DoTrigger($dev, $arg, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
@ -1404,7 +1405,7 @@ CommandDeleteAttr($$)
|
|||||||
|
|
||||||
if($a[1] eq "userReadings") {
|
if($a[1] eq "userReadings") {
|
||||||
#Debug "Deleting userReadings for $sdev";
|
#Debug "Deleting userReadings for $sdev";
|
||||||
delete($defs{$sdev}{fhem}{'.userReadings'});
|
delete($defs{$sdev}{'.userReadings'});
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = CallFn($sdev, "AttrFn", "del", @a);
|
$ret = CallFn($sdev, "AttrFn", "del", @a);
|
||||||
@ -1830,7 +1831,7 @@ CommandAttr($$)
|
|||||||
}
|
}
|
||||||
$arg= defined($7) ? $7 : "";
|
$arg= defined($7) ? $7 : "";
|
||||||
}
|
}
|
||||||
$hash->{fhem}{'.userReadings'}= \%userReadings;
|
$hash->{'.userReadings'}= \%userReadings;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($a[1] eq "IODev" && (!$a[2] || !defined($defs{$a[2]}))) {
|
if($a[1] eq "IODev" && (!$a[2] || !defined($defs{$a[2]}))) {
|
||||||
@ -3055,8 +3056,8 @@ readingsEndUpdate($$)
|
|||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
# process user readings
|
# process user readings
|
||||||
if(defined($hash->{fhem}{'.userReadings'})) {
|
if(defined($hash->{'.userReadings'})) {
|
||||||
my %userReadings= %{$hash->{fhem}{'.userReadings'}};
|
my %userReadings= %{$hash->{'.userReadings'}};
|
||||||
foreach my $userReading (keys %userReadings) {
|
foreach my $userReading (keys %userReadings) {
|
||||||
my $modifier= $userReadings{$userReading}{modifier};
|
my $modifier= $userReadings{$userReading}{modifier};
|
||||||
my $perlCode= $userReadings{$userReading}{perlCode};
|
my $perlCode= $userReadings{$userReading}{perlCode};
|
||||||
@ -3084,9 +3085,9 @@ readingsEndUpdate($$)
|
|||||||
}
|
}
|
||||||
readingsBulkUpdate($hash,$userReading,$result,1) if(defined($result));
|
readingsBulkUpdate($hash,$userReading,$result,1) if(defined($result));
|
||||||
# store value
|
# store value
|
||||||
$hash->{fhem}{'.userReadings'}{$userReading}{TIME}= $hash->{".updateTimestamp"};
|
$hash->{'.userReadings'}{$userReading}{TIME}= $hash->{".updateTimestamp"};
|
||||||
$hash->{fhem}{'.userReadings'}{$userReading}{t}= $hash->{".updateTime"};
|
$hash->{'.userReadings'}{$userReading}{t}= $hash->{".updateTime"};
|
||||||
$hash->{fhem}{'.userReadings'}{$userReading}{value}= $value;
|
$hash->{'.userReadings'}{$userReading}{value}= $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
evalStateFormat($hash);
|
evalStateFormat($hash);
|
||||||
@ -3100,7 +3101,7 @@ readingsEndUpdate($$)
|
|||||||
|
|
||||||
# propagate changes
|
# propagate changes
|
||||||
if($dotrigger && $init_done) {
|
if($dotrigger && $init_done) {
|
||||||
DoTrigger($name, undef, 1) if(!$readingsUpdateDelayTrigger);
|
DoTrigger($name, undef, 0) if(!$readingsUpdateDelayTrigger);
|
||||||
} else {
|
} else {
|
||||||
delete($hash->{CHANGED});
|
delete($hash->{CHANGED});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user