2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

70_ZoneMinder: added attribute apiTimeout

git-svn-id: https://svn.fhem.de/fhem/trunk@18788 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
delmar 2019-03-04 17:54:15 +00:00
parent 230a6d7fec
commit 95c2e2af7a
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # Do not insert empty lines here, update check depends on it.
- feature: 70_ZoneMinder: added attribute 'apiTimeout'
- changed: 93_DbLog: minor change of Log entry - changed: 93_DbLog: minor change of Log entry
- changed: 70_Pushover: attribute 'storage' was renamed to 'storagePath' - changed: 70_Pushover: attribute 'storage' was renamed to 'storagePath'
and is now visible in FHEMWEB and is now visible in FHEMWEB

View File

@ -53,7 +53,7 @@ sub ZoneMinder_Initialize {
$hash->{WriteFn} = "ZoneMinder_Write"; $hash->{WriteFn} = "ZoneMinder_Write";
$hash->{ReadyFn} = "ZoneMinder_Ready"; $hash->{ReadyFn} = "ZoneMinder_Ready";
$hash->{AttrList} = "usePublicUrlForZmWeb:0,1 loginInterval publicAddress webConsoleContext " . $readingFnAttributes; $hash->{AttrList} = "apiTimeout usePublicUrlForZmWeb:0,1 loginInterval publicAddress webConsoleContext " . $readingFnAttributes;
$hash->{MatchList} = { "1:ZM_Monitor" => "^.*" }; $hash->{MatchList} = { "1:ZM_Monitor" => "^.*" };
Log3 '', 3, "ZoneMinder - Initialize done ..."; Log3 '', 3, "ZoneMinder - Initialize done ...";
@ -163,11 +163,13 @@ sub ZoneMinder_API_Login {
my $usePublicUrlForZmWeb = AttrVal($name, 'usePublicUrlForZmWeb', 0); my $usePublicUrlForZmWeb = AttrVal($name, 'usePublicUrlForZmWeb', 0);
my $zmWebUrl = ZoneMinder_getZmWebUrl($hash, $usePublicUrlForZmWeb); my $zmWebUrl = ZoneMinder_getZmWebUrl($hash, $usePublicUrlForZmWeb);
my $loginUrl = "$zmWebUrl/index.php?username=$username&password=$password&action=login&view=console"; my $loginUrl = "$zmWebUrl/index.php?username=$username&password=$password&action=login&view=console";
my $apiTimeout = AttrVal($name, 'apiTimeout', 5);
Log3 $name, 4, "ZoneMinder ($name) - loginUrl: $loginUrl"; Log3 $name, 4, "ZoneMinder ($name) - loginUrl: $loginUrl";
my $apiParam = { my $apiParam = {
url => $loginUrl, url => $loginUrl,
method => "POST", method => "POST",
timeout => $apiTimeout,
callback => \&ZoneMinder_API_Login_Callback, callback => \&ZoneMinder_API_Login_Callback,
hash => $hash hash => $hash
}; };
@ -750,6 +752,7 @@ sub ZoneMinder_Ready {
<b>Attributes</b> <b>Attributes</b>
<br><br> <br><br>
<ul> <ul>
<li><code>apiTimeout &lt;seconds&gt;</code><br>This defines the request timeout in seconds for calls to the ZoneMinder API (right now, only for the login)</li>
<li><code>publicAddress &lt;address&gt;</code><br>This configures public accessibility of your LAN (eg your ddns address). Define a valid URL here, eg <code>https://my.own.domain:2344</code></li> <li><code>publicAddress &lt;address&gt;</code><br>This configures public accessibility of your LAN (eg your ddns address). Define a valid URL here, eg <code>https://my.own.domain:2344</code></li>
<li><code>webConsoleContext &lt;path&gt;</code><br>If not set, this defaults to <code>/zm</code>. This is used for building the URL to the ZoneMinder web console.</li> <li><code>webConsoleContext &lt;path&gt;</code><br>If not set, this defaults to <code>/zm</code>. This is used for building the URL to the ZoneMinder web console.</li>
<li><code>usePublicUrlForZmWeb</code><br>If a public address is defined, this setting will use the public address for connecting to ZoneMinder API, instead of trying to use the IP-address.</li> <li><code>usePublicUrlForZmWeb</code><br>If a public address is defined, this setting will use the public address for connecting to ZoneMinder API, instead of trying to use the IP-address.</li>