mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
10_MQTT2_DEVICE.pm: check the regexp in the readingList (Forum #126969)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@25888 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c00e5d63b3
commit
5e340b9159
@ -474,6 +474,10 @@ MQTT2_DEVICE_Attr($$)
|
||||
return "$dev attr $attrName: more parameters needed" if(!$par2);
|
||||
|
||||
if($atype eq "reading") {
|
||||
$par1 =~ s/\$[a-z0-9_]+/\.\*/gi;
|
||||
eval { "Hallo" =~ m/^$par1$/ };
|
||||
return "Bad regexp in $dev readingList: $@" if($@);
|
||||
|
||||
if($par2 =~ m/^{.*}\s*$/) {
|
||||
my %v = ("%TOPIC"=>1, "%EVENT"=>"0 1 2 3 4 5 6 7 8 9",
|
||||
"%NAME"=>$dev, "%CID"=>"clientId", "%JSONMAP"=>"");
|
||||
|
@ -55,7 +55,7 @@ notify_Define($$)
|
||||
# Checking for misleading regexps
|
||||
return "Bad regexp: starting with *" if($re =~ m/^\*/);
|
||||
eval { "Hallo" =~ m/^$re$/ };
|
||||
return "Bad regexp: $@" if($@);
|
||||
return "Bad regexp in $name definition: $@" if($@);
|
||||
$hash->{REGEXP} = $re;
|
||||
my %specials= (
|
||||
"%NAME" => $name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user