2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

98_JsonList2: readd empty hashes, as alexa breaks (Forum #66018)

git-svn-id: https://svn.fhem.de/fhem/trunk@13291 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-01-31 08:34:40 +00:00
parent 16e487041b
commit db832835e3

View File

@ -56,7 +56,11 @@ JsonList2_dumpHash($$$$$$)
$ret .= "," if($i2 < int(@arr)-1);
$ret .= "\n" if(int(@arr)>1);
}
push(@{$arrp}, " \"$name\": {".(int(@arr)>1 ? "\n" : "")."$ret }") if $ret;
if(@arr > 1) {
push @{$arrp}, " \"$name\": {\n$ret }";
} else {
push @{$arrp}, " \"$name\": { }";
}
}
#####################################