2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 07:16:03 +00:00

Structure state changed

git-svn-id: https://svn.fhem.de/fhem/trunk@1032 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2011-10-01 10:57:43 +00:00
parent 83199d8e2a
commit 5eb1c4a043

View File

@ -51,7 +51,7 @@ structure_Define($$)
} }
} }
$hash->{CONTENT} = \%list; $hash->{CONTENT} = \%list;
$hash->{STATE} = join(" ", sort(keys %{$hash->{CONTENT}})); $hash->{STATE} = "defined";
@a = ( "set", $devname, $stype, $devname ); @a = ( "set", $devname, $stype, $devname );
structure_Attr(@a); structure_Attr(@a);
@ -90,7 +90,6 @@ CommandAddStruct($)
foreach my $d (devspec2array($a[0])) { foreach my $d (devspec2array($a[0])) {
$hash->{CONTENT}{$d} = 1; $hash->{CONTENT}{$d} = 1;
} }
$hash->{STATE} = join(" ", sort(keys %{$hash->{CONTENT}}));
@a = ( "set", $hash->{NAME}, $hash->{ATTR}, $hash->{NAME} ); @a = ( "set", $hash->{NAME}, $hash->{ATTR}, $hash->{NAME} );
structure_Attr(@a); structure_Attr(@a);
@ -117,7 +116,6 @@ CommandDelStruct($)
foreach my $d (devspec2array($a[0])) { foreach my $d (devspec2array($a[0])) {
delete($hash->{CONTENT}{$d}); delete($hash->{CONTENT}{$d});
} }
$hash->{STATE} = join(" ", sort(keys %{$hash->{CONTENT}}));
@a = ( "del", $hash->{NAME}, $hash->{ATTR} ); @a = ( "del", $hash->{NAME}, $hash->{ATTR} );
structure_Attr(@a); structure_Attr(@a);
@ -135,6 +133,9 @@ structure_Set($@)
$hash->{INSET} = 1; $hash->{INSET} = 1;
$hash->{STATE} = join(" ", @list[1..@list-1])
if($list[1] ne "?");
foreach my $d (sort keys %{ $hash->{CONTENT} }) { foreach my $d (sort keys %{ $hash->{CONTENT} }) {
next if(!$defs{$d}); next if(!$defs{$d});
if($defs{$d}{INSET}) { if($defs{$d}{INSET}) {