mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
Timeout changed to 2 sec.
CHANGED expanded to long version thx Axel. git-svn-id: https://svn.fhem.de/fhem/trunk@658 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
afa7b7af32
commit
cb8d8d588e
@ -95,7 +95,7 @@ ALL4000T_GetStatus($)
|
|||||||
my $xml = new XML::Simple;
|
my $xml = new XML::Simple;
|
||||||
|
|
||||||
my $URL="http://".$host."/xml";
|
my $URL="http://".$host."/xml";
|
||||||
my $agent = LWP::UserAgent->new(env_proxy => 1,keep_alive => 1, timeout => 30);
|
my $agent = LWP::UserAgent->new(env_proxy => 1,keep_alive => 1, timeout => 3);
|
||||||
my $header = HTTP::Request->new(GET => $URL);
|
my $header = HTTP::Request->new(GET => $URL);
|
||||||
my $request = HTTP::Request->new('GET', $URL, $header);
|
my $request = HTTP::Request->new('GET', $URL, $header);
|
||||||
my $response = $agent->request($request);
|
my $response = $agent->request($request);
|
||||||
@ -113,7 +113,7 @@ ALL4000T_GetStatus($)
|
|||||||
my $data = $xml->XMLin($body);
|
my $data = $xml->XMLin($body);
|
||||||
my $current=$data->{BODY}->{FORM}->{TEXTAREA}->{xml}->{data}->{$host_port};
|
my $current=$data->{BODY}->{FORM}->{TEXTAREA}->{xml}->{data}->{$host_port};
|
||||||
|
|
||||||
$text="T: ".$current;
|
$text="Temperature:".$current;
|
||||||
my $sensor="temperature";
|
my $sensor="temperature";
|
||||||
Log 4,"$name: $text";
|
Log 4,"$name: $text";
|
||||||
if (!$hash->{local}){
|
if (!$hash->{local}){
|
||||||
@ -122,7 +122,7 @@ ALL4000T_GetStatus($)
|
|||||||
$hash->{READINGS}{$sensor}{VAL} = $current." (Celsius)";;
|
$hash->{READINGS}{$sensor}{VAL} = $current." (Celsius)";;
|
||||||
DoTrigger($name, undef) if($init_done);
|
DoTrigger($name, undef) if($init_done);
|
||||||
}
|
}
|
||||||
$hash->{STATE} = $text;
|
$hash->{STATE} = "T:".$current;
|
||||||
return($text);
|
return($text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user