60_allergy.pm: fixed error handling for server replies
git-svn-id: https://svn.fhem.de/fhem/trunk@13588 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -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.
|
||||||
|
- bugfix: 60_allergy.pm: fixed error handling for server replies
|
||||||
- update: 38_netatmo.pm: 3 stations minimum for PUBLIC statistics
|
- update: 38_netatmo.pm: 3 stations minimum for PUBLIC statistics
|
||||||
- update: 74_AMAD: new Version 2.6.11, add startDaydream and more media
|
- update: 74_AMAD: new Version 2.6.11, add startDaydream and more media
|
||||||
commands
|
commands
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# 60_allergy.pm
|
# 60_allergy.pm
|
||||||
#
|
#
|
||||||
# 2016 Markus Moises < vorname at nachname . de >
|
# 2017 Markus Moises < vorname at nachname . de >
|
||||||
#
|
#
|
||||||
# This module provides allergy forecast data
|
# This module provides allergy forecast data
|
||||||
#
|
#
|
||||||
@@ -46,8 +46,6 @@ sub allergy_Initialize($) {
|
|||||||
"levelsFormat ".
|
"levelsFormat ".
|
||||||
"weekdaysFormat ".
|
"weekdaysFormat ".
|
||||||
$readingFnAttributes;
|
$readingFnAttributes;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub allergy_Define($$$) {
|
sub allergy_Define($$$) {
|
||||||
@@ -60,6 +58,7 @@ sub allergy_Define($$$) {
|
|||||||
|
|
||||||
$hash->{helper}{ZIPCODE} = $a[2];
|
$hash->{helper}{ZIPCODE} = $a[2];
|
||||||
$hash->{helper}{INTERVAL} = 10800;
|
$hash->{helper}{INTERVAL} = 10800;
|
||||||
|
$hash->{ERROR} = 0;
|
||||||
|
|
||||||
my $req = eval
|
my $req = eval
|
||||||
{
|
{
|
||||||
@@ -163,10 +162,14 @@ sub allergy_Parse($$$)
|
|||||||
if( $err )
|
if( $err )
|
||||||
{
|
{
|
||||||
Log3 $name, 1, "$name: URL error: ".$err;
|
Log3 $name, 1, "$name: URL error: ".$err;
|
||||||
$hash->{STATE} = "error";
|
my $nextupdate = gettimeofday()+( (900*$hash->{ERROR}) + 90 );
|
||||||
|
InternalTimer($nextupdate, "allergy_GetUpdate", $hash, 1);
|
||||||
|
$hash->{STATE} = "error" if($hash->{ERROR} > 1);
|
||||||
|
$hash->{ERROR} = $hash->{ERROR}+1;
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hash->{ERROR} = 0;
|
||||||
Log3 $name, 5, "Received XML data ".$data;
|
Log3 $name, 5, "Received XML data ".$data;
|
||||||
|
|
||||||
my $xml = new XML::Simple();
|
my $xml = new XML::Simple();
|
||||||
|
|||||||
Reference in New Issue
Block a user