2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

10_MQTT2_DEVICE.pm: fix parsing of {}

git-svn-id: https://svn.fhem.de/fhem/trunk@21518 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-03-25 23:27:16 +00:00
parent c95a9fd870
commit 5d980991f6
2 changed files with 3 additions and 3 deletions

View File

@ -442,7 +442,7 @@ MQTT2_DEVICE_Attr($$)
return "$dev attr $attrName: more parameters needed" if(!$par2);
if($atype eq "reading") {
if($par2 =~ m/^{.*}\s+$/) {
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",

View File

@ -5262,7 +5262,7 @@ hashKeyRename($$$)
my $val = $hash->{$k};
next if($k !~ m/$r2/ || !defined($repl{$1}));
$k =~ s/$r2/$repl{$1}/;
$ret{makeReadingName($k)} = $val;
$ret{$k} = $val;
}
return \%ret;
}
@ -5285,7 +5285,7 @@ json2reading($$;$$$)
if($ret && ref $ret eq "HASH") {
readingsBeginUpdate($hash);
foreach my $k (keys %{$ret}) {
readingsBulkUpdate($hash, $k, $ret->{$k});
readingsBulkUpdate($hash, makeReadingName($k), $ret->{$k});
}
readingsEndUpdate($hash, 1);
}