2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

10_MQTT2_DEVICE.pm: some better attribtue checking (Forum #102092)

git-svn-id: https://svn.fhem.de/fhem/trunk@20070 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-08-27 09:37:15 +00:00
parent 0adcc872fa
commit f741b4f810

View File

@ -503,10 +503,10 @@ MQTT2_DEVICE_addReading($$)
MQTT2_DEVICE_delReading($name);
foreach my $line (split("\n", $param)) {
my ($re,$code) = split(" ", $line,2);
return "Bad line >$line< for $name" if(!defined($re) || !$defined($code);
eval { "Hallo" =~ m/^$re$/ };
return "Bad regexp: $@" if($@);
$modules{MQTT2_DEVICE}{defptr}{re}{$re}{"$name,$code"} = $code
if($re && $code);
$modules{MQTT2_DEVICE}{defptr}{re}{$re}{"$name,$code"} = $code;
}
return undef;
}