mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
67_ECMDDevice: optimization; honor param in expect
git-svn-id: https://svn.fhem.de/fhem/trunk@11649 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
5a4a98ecf3
commit
cce492564c
@ -151,12 +151,11 @@ ECMDDevice_Changed($$$)
|
||||
|
||||
###################################
|
||||
sub
|
||||
ECMDDevice_PostProc($$$)
|
||||
ECMDDevice_PostProc($$$%)
|
||||
{
|
||||
my ($hash, $postproc, $value)= @_;
|
||||
my ($hash, $postproc, $value, %specials)= @_;
|
||||
|
||||
if($postproc) {
|
||||
my %specials= ECMDDevice_GetCachedSpecials($hash);
|
||||
my $command= ECMDDevice_ReplaceSpecials($postproc, %specials);
|
||||
$_= $value;
|
||||
Log3 $hash, 5, "Postprocessing \"" . escapeLogLine($value) . "\" with perl command $command.";
|
||||
@ -237,12 +236,13 @@ ECMDDevice_Get($@)
|
||||
}
|
||||
}
|
||||
$ecmd= ECMDDevice_ReplaceSpecials($ecmd, %specials);
|
||||
$expect= ECMDDevice_ReplaceSpecials($expect, %specials);
|
||||
|
||||
my $r = ECMDDevice_AnalyzeCommand($hash, $ecmd);
|
||||
|
||||
my $v= IOWrite($hash, $r, $expect);
|
||||
|
||||
$v= ECMDDevice_PostProc($hash, $postproc, $v);
|
||||
$v= ECMDDevice_PostProc($hash, $postproc, $v, %specials);
|
||||
|
||||
return ECMDDevice_Changed($hash, $cmdname, $v);
|
||||
}
|
||||
@ -284,12 +284,13 @@ ECMDDevice_Set($@)
|
||||
}
|
||||
}
|
||||
$ecmd= ECMDDevice_ReplaceSpecials($ecmd, %specials);
|
||||
$expect= ECMDDevice_ReplaceSpecials($expect, %specials);
|
||||
|
||||
my $r = ECMDDevice_AnalyzeCommand($hash, $ecmd);
|
||||
|
||||
my $v= IOWrite($hash, $r, $expect);
|
||||
|
||||
$v= ECMDDevice_PostProc($hash, $postproc, $v);
|
||||
$v= ECMDDevice_PostProc($hash, $postproc, $v, %specials);
|
||||
|
||||
ECMDDevice_Changed($hash, $cmdname, $v); # was: return ECMDDevice_Changed($hash, $cmdname, $v);
|
||||
return undef;
|
||||
|
Loading…
Reference in New Issue
Block a user