2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-14 05:46:35 +00:00

Fixes for bugs reported by Martin

git-svn-id: https://svn.fhem.de/fhem/trunk@553 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2010-01-20 08:47:08 +00:00
parent 5a5a579d14
commit ca6c0d2f67
2 changed files with 13 additions and 12 deletions

View File

@ -48,7 +48,9 @@ structure_Define($$)
my %list;
foreach my $a (@a) {
$list{$a} = 1;
foreach my $d (devspec2array($a)) {
$list{$d} = 1;
}
}
$hash->{CONTENT} = \%list;
$hash->{STATE} = join(" ", sort(keys %{$hash->{CONTENT}}));

View File

@ -22,7 +22,7 @@ sub
XmlEscape($)
{
my $a = shift;
return "" if(!$a);
return "" if(!defined($a));
$a =~ s/\\\n/<br>/g; # Multi-line
$a =~ s/&/&amp;/g;
$a =~ s/"/&quot;/g;
@ -41,14 +41,13 @@ CommandXmlList($$)
my $lt = "";
delete($modules{""}) if(defined($modules{""}));
for my $d (sort { my $x = $modules{$defs{$a}{TYPE}}{ORDER} cmp
$modules{$defs{$b}{TYPE}}{ORDER};
for my $d (sort { my $x = $defs{$a}{TYPE}.$modules{$defs{$a}{TYPE}}{ORDER} cmp
$defs{$b}{TYPE}.$modules{$defs{$b}{TYPE}}{ORDER};
$x = ($a cmp $b) if($x == 0); $x; } keys %defs) {
next if(IsIgnored($d));
my $p = $defs{$d};
my $t = $p->{TYPE};
if($t ne $lt) {
$str .= "\t</${lt}_LIST>\n" if($lt);
$str .= "\t<${t}_LIST>\n";
@ -78,7 +77,7 @@ CommandXmlList($$)
if($r) {
foreach my $c (sort keys %{$r}) {
my $h = $r->{$c};
next if(!$h->{VAL} || !$h->{TIME});
next if(!defined($h->{VAL}) || !defined($h->{TIME}));
$str .=
sprintf("\t\t\t<STATE key=\"%s\" value=\"%s\" measured=\"%s\"/>\n",
XmlEscape($c), XmlEscape($h->{VAL}), $h->{TIME});