2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

trigger state only once if followDevices is not set

git-svn-id: https://svn.fhem.de/fhem/trunk@6115 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-06-14 20:11:29 +00:00
parent a6b4855802
commit 3b909603dd

View File

@ -585,6 +585,7 @@ LightScene_Set($@)
@devices = @{$hash->{devices}};
}
my $first = 1;
foreach my $d (@devices) {
next if(!$defs{$d});
if($defs{$d}{INSET}) {
@ -608,7 +609,8 @@ LightScene_Set($@)
$ret .= $d .": ". $state ."\n" if( defined($FW_webArgs{room}) && $FW_webArgs{room} eq "all" ); #only if telnet
} elsif ( $cmd eq "scene" ) {
readingsSingleUpdate($hash, "state", $scene, 1 ) if( !$hash->{followDevices} );
readingsSingleUpdate($hash, "state", $scene, 1 ) if( $first && !$hash->{followDevices} );
next if( !defined($hash->{SCENES}{$scene}{$d}));
my $state = $hash->{SCENES}{$scene}{$d};
@ -629,6 +631,8 @@ LightScene_Set($@)
} else {
$ret = "Unknown argument $cmd, choose one of save scene";
}
$first = 0;
}
delete($hash->{INSET});