fhem.pl: Do not regexp-check undef in ReadingsNum (Foum #70496)
git-svn-id: https://svn.fhem.de/fhem/trunk@13983 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -3974,6 +3974,7 @@ ReadingsNum($$$;$)
|
|||||||
{
|
{
|
||||||
my ($d,$n,$default,$round) = @_;
|
my ($d,$n,$default,$round) = @_;
|
||||||
my $val = ReadingsVal($d,$n,$default);
|
my $val = ReadingsVal($d,$n,$default);
|
||||||
|
return undef if(!defined($val));
|
||||||
$val = ($val =~ /(-?\d+(\.\d+)?)/ ? $1 : "");
|
$val = ($val =~ /(-?\d+(\.\d+)?)/ ? $1 : "");
|
||||||
$val = round($val,$round) if($round);
|
$val = round($val,$round) if($round);
|
||||||
return $val;
|
return $val;
|
||||||
|
|||||||
Reference in New Issue
Block a user