mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-27 20:34:52 +00:00
77_UWZ: remove last InternalTimer Fn parameter
git-svn-id: https://svn.fhem.de/fhem/trunk@19869 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e4b0141253
commit
393478fe23
@ -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.
|
||||||
|
- change: 77_UWZ: remove last InternalTimer Fn parameter
|
||||||
- feature: 14_SD_WS.pm: crc calculation fixes and
|
- feature: 14_SD_WS.pm: crc calculation fixes and
|
||||||
new protocol for Atech wireless weather station
|
new protocol for Atech wireless weather station
|
||||||
added new sensor TECVANCE TV-4848
|
added new sensor TECVANCE TV-4848
|
||||||
|
@ -166,6 +166,7 @@ BEGIN {
|
|||||||
BlockingKill
|
BlockingKill
|
||||||
init_done
|
init_done
|
||||||
FW_httpheader
|
FW_httpheader
|
||||||
|
HttpUtils_BlockingGet
|
||||||
deviceEvents)
|
deviceEvents)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -844,27 +845,25 @@ sub JSONAcquire($$) {
|
|||||||
|
|
||||||
Log $hash, 4, "Start capturing of $URL";
|
Log $hash, 4, "Start capturing of $URL";
|
||||||
|
|
||||||
my $err_log = "";
|
my $param = {
|
||||||
my $agent = LWP::UserAgent->new(
|
url => "$URL",
|
||||||
env_proxy => 1,
|
timeout => 5,
|
||||||
keep_alive => 1,
|
hash => $hash,
|
||||||
protocols_allowed => ['http'],
|
method => "GET",
|
||||||
timeout => 10
|
header => "",
|
||||||
);
|
};
|
||||||
my $request = HTTP::Request->new( GET => $URL );
|
|
||||||
my $response = $agent->request($request);
|
|
||||||
$err_log = "Can't get $URL -- " . $response->status_line
|
|
||||||
unless ( $response->is_success );
|
|
||||||
|
|
||||||
if ( $err_log ne "" ) {
|
my ( $err, $data ) = HttpUtils_BlockingGet($param);
|
||||||
readingsSingleUpdate( $hash, "lastConnection", $response->status_line,
|
|
||||||
1 );
|
if ( $err ne "" ) {
|
||||||
|
my $err_log = "Can't get $URL -- " . $err;
|
||||||
|
readingsSingleUpdate( $hash, "lastConnection", $err, 1 );
|
||||||
Log $hash, 1, "Error: $err_log";
|
Log $hash, 1, "Error: $err_log";
|
||||||
return "Error|Error " . $response->status_line;
|
return "Error|Error " . $err;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log $hash, 4, length( $response->content ) . " characters captured";
|
Log $hash, 4, length($data) . " characters captured: $data";
|
||||||
return $response->content;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@ -880,7 +879,7 @@ sub Start($) {
|
|||||||
|
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
InternalTimer( gettimeofday() + $hash->{INTERVAL},
|
InternalTimer( gettimeofday() + $hash->{INTERVAL},
|
||||||
"UWZ_Start", $hash, 1 );
|
"UWZ_Start", $hash );
|
||||||
return undef if ( IsDisabled($name) );
|
return undef if ( IsDisabled($name) );
|
||||||
readingsSingleUpdate( $hash, 'currentIntervalMode', 'normal', 0 );
|
readingsSingleUpdate( $hash, 'currentIntervalMode', 'normal', 0 );
|
||||||
}
|
}
|
||||||
@ -2542,7 +2541,7 @@ sub IntervalAtWarnLevel($) {
|
|||||||
|
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
InternalTimer( gettimeofday() + $hash->{INTERVALWARN},
|
InternalTimer( gettimeofday() + $hash->{INTERVALWARN},
|
||||||
"UWZ_Start", $hash, 1 );
|
"UWZ_Start", $hash );
|
||||||
|
|
||||||
Log $hash, 4,
|
Log $hash, 4,
|
||||||
"restart internal timer with interval $hash->{INTERVALWARN}";
|
"restart internal timer with interval $hash->{INTERVALWARN}";
|
||||||
@ -2552,7 +2551,7 @@ sub IntervalAtWarnLevel($) {
|
|||||||
|
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
InternalTimer( gettimeofday() + $hash->{INTERVALWARN},
|
InternalTimer( gettimeofday() + $hash->{INTERVALWARN},
|
||||||
"UWZ_Start", $hash, 1 );
|
"UWZ_Start", $hash );
|
||||||
|
|
||||||
Log $hash, 4,
|
Log $hash, 4,
|
||||||
"restart internal timer with interval $hash->{INTERVALWARN}";
|
"restart internal timer with interval $hash->{INTERVALWARN}";
|
||||||
@ -3624,7 +3623,7 @@ sub UWZSearchAreaID($$) {
|
|||||||
],
|
],
|
||||||
"release_status": "stable",
|
"release_status": "stable",
|
||||||
"license": "GPL_2",
|
"license": "GPL_2",
|
||||||
"version": "v2.2.0",
|
"version": "v2.2.2",
|
||||||
"author": [
|
"author": [
|
||||||
"Marko Oldenburg <leongaultier@gmail.com>"
|
"Marko Oldenburg <leongaultier@gmail.com>"
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user