diff --git a/fhem/CHANGED b/fhem/CHANGED
index 86445d07c..27ed320e8 100644
--- a/fhem/CHANGED
+++ b/fhem/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: 49_IPCAM: introduced attribute 'blocking'
- bugfix: 47_OBIS: Support Holley-smartmeters with negative metering
- change: 10_KNX: major rewrite of the module. pls. check forum #122582
before shutdown/restart! fixed crash using Attr KNX_toggle
diff --git a/fhem/FHEM/49_IPCAM.pm b/fhem/FHEM/49_IPCAM.pm
index f9d8f3524..44f703805 100644
--- a/fhem/FHEM/49_IPCAM.pm
+++ b/fhem/FHEM/49_IPCAM.pm
@@ -47,7 +47,7 @@ IPCAM_Initialize($$)
"cmd01data cmd02data cmd03data cmd04data cmd05data cmd06data cmd07data ".
"cmd08data cmd09data cmd10data cmd11data cmd12data cmd13data cmd14data cmd15data ".
"model do_not_notify:1,0 showtime:1,0 scheme:http,https ".
- "disable:0,1 unknownFormatRetryDelay handleAnyXmlAsSvg:0,1 unknownFormatRetryCount ".
+ "disable:0,1 unknownFormatRetryDelay handleAnyXmlAsSvg:0,1 unknownFormatRetryCount blocking:0,1 ".
$readingFnAttributes;
}
@@ -90,6 +90,7 @@ BEGIN {
attr
TimeNow
HttpUtils_NonblockingGet
+ GetFileFromURLQuiet
SetExtensions
AttrTemplate_Set
urlEncode
@@ -483,8 +484,9 @@ sub ExecuteSnapshotRequest {
my ($hash, $callbackCommand) = @_;
my $name = $hash->{NAME};
+ my $blocking = AttrVal($name, 'blocking', 0);
my $camUrl = createSnapshotUrl($hash);
- Log3 $name, 3, "IPCAM ($name) - ExecuteSnapshotRequest camUrl: $camUrl";
+ Log3 $name, 3, "IPCAM ($name) - ExecuteSnapshotRequest blocking: $blocking, camUrl: $camUrl";
my $apiParam = {
url => $camUrl,
@@ -496,12 +498,11 @@ sub ExecuteSnapshotRequest {
callbackCommand => $callbackCommand
};
- # trying to fix timeouts by wrapping this in internalTimer
- if (defined $callbackCommand) {
- InternalTimer(gettimeofday(), "main::HttpUtils_NonblockingGet", $apiParam);
+ if ($blocking == 1) {
+ my $camret = GetFileFromURLQuiet($camUrl);
+ RequestSnapshot_Callback($apiParam, '', $camret);
} else {
- # without callback command, the internal timer has been set before already.
- HttpUtils_NonblockingGet($apiParam);
+ HttpUtils_NonblockingGet($apiParam);
}
return undef;
@@ -880,6 +881,11 @@ DetailFn {
These placeholders will be replaced with the values from the credentials file.
Example:
attr ipcam3 basicauth {USERNAME}:{PASSWORD}
+