From 5ee7c07f787e828ff8f501cf4ec8f6eae82b3300 Mon Sep 17 00:00:00 2001 From: delmar <> Date: Mon, 4 Mar 2019 17:54:15 +0000 Subject: [PATCH] 70_ZoneMinder: added attribute apiTimeout git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@18788 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- CHANGED | 1 + FHEM/70_ZoneMinder.pm | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGED b/CHANGED index 53609b6bd..a225a990d 100644 --- a/CHANGED +++ b/CHANGED @@ -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. + - feature: 70_ZoneMinder: added attribute 'apiTimeout' - changed: 93_DbLog: minor change of Log entry - changed: 70_Pushover: attribute 'storage' was renamed to 'storagePath' and is now visible in FHEMWEB diff --git a/FHEM/70_ZoneMinder.pm b/FHEM/70_ZoneMinder.pm index 56d861004..4ddd159cd 100755 --- a/FHEM/70_ZoneMinder.pm +++ b/FHEM/70_ZoneMinder.pm @@ -53,7 +53,7 @@ sub ZoneMinder_Initialize { $hash->{WriteFn} = "ZoneMinder_Write"; $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" => "^.*" }; Log3 '', 3, "ZoneMinder - Initialize done ..."; @@ -163,11 +163,13 @@ sub ZoneMinder_API_Login { my $usePublicUrlForZmWeb = AttrVal($name, 'usePublicUrlForZmWeb', 0); my $zmWebUrl = ZoneMinder_getZmWebUrl($hash, $usePublicUrlForZmWeb); 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"; my $apiParam = { url => $loginUrl, method => "POST", + timeout => $apiTimeout, callback => \&ZoneMinder_API_Login_Callback, hash => $hash }; @@ -750,6 +752,7 @@ sub ZoneMinder_Ready { Attributes