mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-07 16:59:18 +00:00
34_ESPEasy.pm: Remove FHEM cmd from ESPEasy cmd if userSetCmds "args == -1"
git-svn-id: https://svn.fhem.de/fhem/trunk@18608 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1080aba837
commit
f1c397a6a5
@ -37,7 +37,7 @@ use HttpUtils;
|
||||
use Color;
|
||||
use SetExtensions;
|
||||
|
||||
my $module_version = "2.17"; # Version of this module
|
||||
my $module_version = "2.18"; # Version of this module
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# modul version and required ESP Easy firmware / JSON lib version
|
||||
@ -1911,7 +1911,9 @@ sub ESPEasy_httpReq(@)
|
||||
else {
|
||||
my $plist = join(",",@cmdArgs); # join cmd params into a string to be used in http url
|
||||
$plist = ",".$plist if @cmdArgs; # add leading comma if defined
|
||||
$url = "http://".$host.":".$port.$path.$cmd.$plist; # build full url
|
||||
$url = "http://".$host.":".$port.$path; # build base url
|
||||
$url .= $cmd if($data{ESPEasy}{$dname}{sets}{$cmd}{args} ne "-1"); #Forum 97301
|
||||
$url .= $plist;
|
||||
}
|
||||
|
||||
my $httpParams = {
|
||||
@ -4543,7 +4545,12 @@ sub ESPEasy_dumpSingleLine($)
|
||||
Argument must be a <a href="https://perldoc.perl.org/perldsc.html#Declaration-of-a-HASH-OF-HASHES">perl hash</a>.
|
||||
The following hash keys can be used. An omitted key will be replaced with the appropriate default value.<br>
|
||||
<ul>
|
||||
<li><code>args:</code> minimum number of required arguments. Default: 0</li>
|
||||
<li><code>args:</code> minimum number of required arguments for set cmd.
|
||||
Default: 0, no additional arguments required.<br>
|
||||
[Special case: if set to -1 then <FHEM cmd> will not be added to
|
||||
<ESP Easy cmd>. Useful if <FHEM cmd> differs from
|
||||
<ESP Easy cmd>. <ESP Easy cmd> must then be part of url hash key. See
|
||||
<a href="https://forum.fhem.de/index.php?topic=97301">Forum</a> or example myCmd4 below.]</li>
|
||||
<li><code>url:</code> ESPEasy URL to be called. Default: "/control?cmd="</li>
|
||||
<li><code>widget:</code> <a href="#widgetOverride">FHEM widget</a> to be
|
||||
used for this set command. Default: none
|
||||
@ -4574,6 +4581,7 @@ sub ESPEasy_dumpSingleLine($)
|
||||
<li><code>( myCmd1 => {}, myCmd2 => {} )</code></li>
|
||||
<li><code>( myCmd3 => {args => 2, url => "/?cmd=", widget=> "",
|
||||
usage => "<param1> <param2>"} )</code></li>
|
||||
<li><code>( myCmd4 => {url =>"/control?cmd=event,myevent", args => -1} )</code></li>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user