mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
10_MQTT2_DEVICE.pm: fix: space after perlexpr, topic-regexp (Forum #109521)
git-svn-id: https://svn.fhem.de/fhem/trunk@21513 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b0d99e2031
commit
85fc892ae5
@ -256,7 +256,9 @@ MQTT2_DEVICE_Parse($$)
|
||||
next if(!AttrVal($nn, "autocreate", 1)); # device autocreate
|
||||
my $rl = AttrVal($nn, "readingList", "");
|
||||
$rl .= "\n" if($rl);
|
||||
my $regex = ($cid eq $newCid ? "$cid:" : "").$topic.":.*";
|
||||
my $reTopic = $topic;
|
||||
$reTopic =~ s#([^A-Z0-9_/-])#"\\x".sprintf("%02x",ord($1))#ige;
|
||||
my $regex = ($cid eq $newCid ? "$cid:" : "").$reTopic.":.*";
|
||||
CommandAttr(undef, "$nn readingList $rl$regex $add")
|
||||
if(index($rl, $regex) == -1); # Forum #84372
|
||||
setReadingsVal($defs{$nn}, "associatedWith", $parentBridge, TimeNow())
|
||||
@ -310,7 +312,7 @@ MQTT2_buildCmd($$$)
|
||||
my ($hash, $a, $cmd) = @_;
|
||||
|
||||
shift @{$a};
|
||||
if($cmd =~ m/^{.*}$/) {
|
||||
if($cmd =~ m/^{.*}\s+$/) {
|
||||
$cmd = EvalSpecials($cmd,
|
||||
("%EVENT" => join(" ",@{$a}),
|
||||
"%NAME" => $hash->{NAME},
|
||||
@ -440,7 +442,7 @@ MQTT2_DEVICE_Attr($$)
|
||||
return "$dev attr $attrName: more parameters needed" if(!$par2);
|
||||
|
||||
if($atype eq "reading") {
|
||||
if($par2 =~ m/^{.*}$/) {
|
||||
if($par2 =~ m/^{.*}\s+$/) {
|
||||
my $ret = perlSyntaxCheck($par2,
|
||||
("%TOPIC"=>1, "%EVENT"=>"0 1 2 3 4 5 6 7 8 9",
|
||||
"%NAME"=>$dev, "%CID"=>"clientId",
|
||||
|
Loading…
x
Reference in New Issue
Block a user