check newLocation insert

This commit is contained in:
Marko Oldenburg 2019-09-16 08:16:55 +02:00
parent c45d3be028
commit 39704839ee

View File

@ -581,7 +581,10 @@ sub Weather_Set($@) {
($lat,$long) = split(',',$a[2])
if ( defined($a[2]) and $a[2] );
($lat,$long) = split(',',$hash->{fhem}->{LOCATION})
unless ( defined($lat) and defined($long) );
unless ( defined($lat)
and defined($long)
and $lat =~ /(-?\d+(\.\d+)?)/
and $long =~ /(-?\d+(\.\d+)?)/ );
$hash->{fhem}->{api}->setLocation($lat,$long);
Weather_DisarmTimer($hash);