From 26cdf2c8e202a7dd86158bce257bbaebb3576276 Mon Sep 17 00:00:00 2001 From: m_fischer <> Date: Thu, 21 Jan 2010 19:29:47 +0000 Subject: [PATCH] dummy/structure was listed twice in list and xmllist fixed (by rudi) git-svn-id: https://svn.fhem.de/fhem/trunk@557 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/fhem.pl | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 5fadf9115..7626b026d 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -567,4 +567,5 @@ - bugfix: [pgm3] table-format on Android-Browser optimized - feature: [pgm3] Skinable - change the colors. - feature: [pgm3] Rooms possible for Webcam and Google-Weather + - bugfix: dummy/structure was listed twice in list and xmllist diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 6674b916a..3ee98af4f 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -159,7 +159,7 @@ my $nextat; # Time when next timer will be triggered. my $intAtCnt=0; my %duplicate; # Pool of received msg for multi-fhz/cul setups my $duplidx=0; # helper for the above pool -my $cvsid = '$Id: fhem.pl,v 1.99 2010-01-20 08:56:17 rudolfkoenig Exp $'; +my $cvsid = '$Id: fhem.pl,v 1.100 2010-01-21 19:29:47 m_fischer Exp $'; my $namedef = "where is either:\n" . "- a single device name\n" . @@ -1244,9 +1244,9 @@ CommandList($$) my $lt = ""; # Sort first by type then by name - for my $d (sort { my $x = $modules{$defs{$a}{TYPE}}{ORDER} cmp - $modules{$defs{$b}{TYPE}}{ORDER}; - $x = ($a cmp $b) if($x == 0); $x; } keys %defs) { + for my $d (sort { my $x=$modules{$defs{$a}{TYPE}}{ORDER}.$defs{$a}{TYPE} cmp + $modules{$defs{$b}{TYPE}}{ORDER}.$defs{$b}{TYPE}; + $x=($a cmp $b) if($x == 0); $x; } keys %defs) { next if(IsIgnored($d)); my $t = $defs{$d}{TYPE}; $str .= "\n$t:\n" if($t ne $lt); @@ -1604,7 +1604,9 @@ CommandSetstate($$) } } else { - $d->{STATE} = $a[1]; + + # Do not overwrite state like "opened" or "initialized" + $d->{STATE} = $a[1] if($init_done || $d->{STATE} eq "???"); $oldvalue{$sdev}{VAL} = $a[1]; # This time is not the correct one, but we do not store a timestamp for