66_ECMD, 67_ECMDDevice: minor fixes to account for undefined attributes, one fix for commandref

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@12877 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2016-12-26 09:15:55 +00:00
parent 1c41099f68
commit 7360e8e9a3
2 changed files with 6 additions and 6 deletions

View File

@ -642,7 +642,7 @@ ECMD_Write($$$)
$answer= ECMD_SimpleExpect($hash, $msg, $expect);
$answer= "" unless(defined($answer));
ECMD_Log $hash, 5, "received answer " . dq($answer);
$answer.= $responseSeparator if($#ecmds>0);
$answer.= $responseSeparator if(defined($responseSeparator) && ($#ecmds>0));
$ret.= $answer;
} else {
ECMD_SimpleWrite($hash, $msg);
@ -795,7 +795,7 @@ ECMD_Write($$$)
A single command from FHEM to the device might need to be broken down into several requests.
A command string is split at all
occurrences of the request separator. The request separator itself is removed from the command string and thus is
not part of the request. The default is to have no response separator. Use a request separator that does not occur in the actual request.
not part of the request. The default is to have no request separator. Use a request separator that does not occur in the actual request.
</li>
<li>responseSeparator &lt;separator&gt<br>
In order to identify the single responses from the device for each part of the command broken down by request separators, a response separator can be appended to the response to each single request.

View File

@ -160,9 +160,9 @@ ECMDDevice_PostProc($$$%)
if($postproc) {
my $command= ECMDDevice_ReplaceSpecials($postproc, %specials);
$_= $value;
Log3 $hash, 5, "Postprocessing \"" . escapeLogLine($value) . "\" with perl command $command.";
Log3 $hash, 5, "Postprocessing \"" . dq($value) . "\" with perl command $command.";
$value= AnalyzePerlCommand(undef, $command);
Log3 $hash, 5, "Postprocessed value is \"" . escapeLogLine($value) . "\".";
Log3 $hash, 5, "Postprocessed value is \"" . dq($value) . "\".";
}
return $value;
}
@ -174,9 +174,9 @@ ECMDDevice_EvalCommand($$$)
if($command) {
$_= $value;
Log3 $hash, 5, "Postprocessing \"" . escapeLogLine($value) . "\" with perl command $command.";
Log3 $hash, 5, "Postprocessing \"" . dq($value) . "\" with perl command $command.";
$value= AnalyzePerlCommand(undef, $command);
Log3 $hash, 5, "Postprocessed value is \"" . escapeLogLine($value) . "\".";
Log3 $hash, 5, "Postprocessed value is \"" . dq($value) . "\".";
}
return $value;
}