2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

59_Twilight: prevent uninitialized warning w missing ext. weather device

git-svn-id: https://svn.fhem.de/fhem/trunk@24945 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2021-09-10 19:31:25 +00:00
parent b30d3d29db
commit b18876e3b4

View File

@ -198,7 +198,7 @@ sub Twilight_Change_DEF {
my @wd = devspec2array("TYPE=Weather|PROPLANTA");
my ($err, $wreading);
($err, $wreading) = Twilight_disp_ExtWeather($hash, $wd[0]) if $wd[0];
$weather = $err ? "" : $wd[0] ;
$weather = $err || !defined $wd[0] ? q{} : $wd[0] ;
}
$newdef = "$hash->{helper}{'.LATITUDE'} $hash->{helper}{'.LONGITUDE'}" if $hash->{helper}{'.LATITUDE'} != AttrVal( 'global', 'latitude', 50.112 ) || $hash->{helper}{'.LONGITUDE'} != AttrVal( 'global', 'longitude', 8.686 );
$newdef .= " $hash->{INDOOR_HORIZON} $weather";