PROPLANTA: bugfix
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@6859 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -269,8 +269,8 @@ sub PROPLANTA_Log($$$)
|
|||||||
my $sub = ( split( ':', $xsubroutine ) )[2];
|
my $sub = ( split( ':', $xsubroutine ) )[2];
|
||||||
$sub =~ s/PROPLANTA_//;
|
$sub =~ s/PROPLANTA_//;
|
||||||
|
|
||||||
my $instName = ( ref($hash) eq "HASH" ) ? $hash->{NAME} : $MODUL;
|
my $instName = ( ref($hash) eq "HASH" ) ? $hash->{NAME} : $hash;
|
||||||
Log3 $hash, $loglevel, "$MODUL $instName: $sub.$xline " . $text;
|
Log3 $instName, $loglevel, "$MODUL $instName: $sub.$xline " . $text;
|
||||||
}
|
}
|
||||||
###################################
|
###################################
|
||||||
sub PROPLANTA_Initialize($)
|
sub PROPLANTA_Initialize($)
|
||||||
@@ -305,6 +305,8 @@ sub PROPLANTA_Define($$)
|
|||||||
$hash->{INTERVAL} = 3600;
|
$hash->{INTERVAL} = 3600;
|
||||||
|
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
|
|
||||||
|
#Get first data after 12 seconds
|
||||||
InternalTimer( gettimeofday() + 12, "PROPLANTA_Start", $hash, 0 );
|
InternalTimer( gettimeofday() + 12, "PROPLANTA_Start", $hash, 0 );
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
@@ -400,11 +402,8 @@ sub PROPLANTA_Start($)
|
|||||||
if(!$hash->{LOCAL} && $hash->{INTERVAL} > 0) {
|
if(!$hash->{LOCAL} && $hash->{INTERVAL} > 0) {
|
||||||
# setup timer
|
# setup timer
|
||||||
RemoveInternalTimer( $hash );
|
RemoveInternalTimer( $hash );
|
||||||
InternalTimer(
|
InternalTimer(gettimeofday() + $hash->{INTERVAL}, "PROPLANTA_Start", $hash, 1 );
|
||||||
gettimeofday() + $hash->{INTERVAL},
|
return undef if( AttrVal($name, "disable", 0 ) == 1 );
|
||||||
"PROPLANTA_Start",
|
|
||||||
$name,
|
|
||||||
1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( AttrVal( $name, 'URL', '') eq '' && not defined( $hash->{URL} ) )
|
if ( AttrVal( $name, 'URL', '') eq '' && not defined( $hash->{URL} ) )
|
||||||
@@ -475,7 +474,7 @@ sub PROPLANTA_Done($)
|
|||||||
|
|
||||||
# Wetterdaten speichern
|
# Wetterdaten speichern
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
readingsBulkUpdate($hash, "state", sprintf "T: %.1f H: %.1f W: %.1f P: %.0f ", $values{temperature}, $values{humidity}, $values{wind}, $values{pressure} );
|
readingsBulkUpdate($hash, "state", sprintf "T: %.1f H: %.1f W: %.1f P: %.1f ", $values{temperature}, $values{humidity}, $values{wind}, $values{pressure} );
|
||||||
|
|
||||||
my $x = 0;
|
my $x = 0;
|
||||||
while (my ($rName, $rValue) = each(%values) )
|
while (my ($rName, $rValue) = each(%values) )
|
||||||
|
|||||||
Reference in New Issue
Block a user