31_LightScene.pm: workaround for global $scn and multiple tabs

git-svn-id: https://svn.fhem.de/fhem/trunk@16181 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2018-02-14 20:20:12 +00:00
parent c747ad9503
commit 6c27581126

View File

@ -942,6 +942,17 @@ LightScene_editTable($) {
$dd.=FW_hidden("detail",$hash->{NAME}) . "\n"; $dd.=FW_hidden("detail",$hash->{NAME}) . "\n";
$dd.="</form>\n"; $dd.="</form>\n";
# make table # make table
my @devices;
if( $scn && defined($hash->{SCENES}{$scn}) ) {
if( defined($hash->{switchingOrder}) && defined($hash->{switchingOrder}{$scn}) ) {
@devices = @{$hash->{switchingOrder}{$scn}};
} else {
@devices = @{$hash->{devices}};
}
} else {
$scn = '';
}
if ($scn eq "Choose scene" || $scn eq '') { if ($scn eq "Choose scene" || $scn eq '') {
$html.="<table><tr><td>Edit scene</td><td>$dd</td></tr>"; $html.="<table><tr><td>Edit scene</td><td>$dd</td></tr>";
} else { } else {
@ -949,12 +960,6 @@ LightScene_editTable($) {
$html .= '<table class="block wide">'; $html .= '<table class="block wide">';
$html .= '<tr><th>Device</th><th>Command</th></tr>'."\n"; $html .= '<tr><th>Device</th><th>Command</th></tr>'."\n";
my $row=0; my $row=0;
my @devices;
if( $scn && defined($hash->{switchingOrder}) && defined($hash->{switchingOrder}{$scn}) ) {
@devices = @{$hash->{switchingOrder}{$scn}};
} else {
@devices = @{$hash->{devices}};
}
#table rows #table rows
my @cmds = qw(set setcmd); my @cmds = qw(set setcmd);
my $set = "set $hash->{NAME} set $scn"; my $set = "set $hash->{NAME} set $scn";