mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
49_IPCAM: set-magic for POST data (eg resolving [device:reading])
git-svn-id: https://svn.fhem.de/fhem/trunk@23924 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ff4a54a98d
commit
85d05a1d03
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- new: 49_IPCAM: set-magic for POST data (eg resolving [device:reading])
|
||||
- new: 49_IPCAM: added POST for custom commands cmd01-cmd15
|
||||
- new: 49_IPCAM: imageWithCallback now also interprets [device:reading]
|
||||
- bugfix: 49_IPCAM: fixed imageWithCallback using previous image
|
||||
|
@ -289,6 +289,13 @@ sub SendCommand {
|
||||
Log3 $name, 3, "IPCAM ($name) - sending command $commandId: $camUrl";
|
||||
my $postData = AttrVal($name, $commandId.'data', undef);
|
||||
if (defined $postData) {
|
||||
my %dummy;
|
||||
my ($err, @a) = ReplaceSetMagic(\%dummy, 0, ( $postData ) );
|
||||
if ( $err ) {
|
||||
Log3 $name, 0, "IPCAM ($name) - parse post data failed on ReplaceSetMagic with :$err: on :$postData:";
|
||||
} else {
|
||||
$postData = join(" ", @a);
|
||||
}
|
||||
$apiParam->{data} = $postData;
|
||||
$apiParam->{method} = 'POST';
|
||||
Log3 $name, 3, "IPCAM ($name) - post data for $commandId: $postData";
|
||||
@ -844,7 +851,10 @@ DetailFn {
|
||||
You can define the POST data that is to be sent with the according cmd.<br>
|
||||
If this is defined, the request will be POST instead of GET.<br>
|
||||
Example:<br>
|
||||
<code>attr ipcam cmd01data [{"cmd":"Login"},{"cmd":"SetOSD"}]</code>
|
||||
<code>attr ipcam cmd01data [{"cmd":"Login"},{"cmd":"SetOSD"}]</code><br>
|
||||
You can provide references to readings and internals easliy like this:<br>
|
||||
<code>attr ipcam cmd01data [{"cmd":"Login"},{"cmd":"SetOSD"},{"key":"[devicename:reading]"}]</code><br>
|
||||
will be resolved into <code>[{"cmd":"Login"},{"key":"value-from-reading"}]</code>
|
||||
</li>
|
||||
<li>
|
||||
cmdPanLeft, cmdPanRight, cmdTiltUp, cmdTiltDown, cmdStep<br>
|
||||
|
Loading…
Reference in New Issue
Block a user