mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
31_LightScene.pm: added nowrap option to nextScene and previousScene commands
git-svn-id: https://svn.fhem.de/fhem/trunk@12878 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
6b89a6160b
commit
39aa0683c8
@ -590,7 +590,7 @@ LightScene_Set($@)
|
||||
|
||||
my @sorted = sort keys %{$hash->{SCENES}};
|
||||
|
||||
if( $cmd eq "?" ){ return "Unknown argument ?, choose one of remove:".join(",", @sorted) ." rename save set setcmd scene:".join(",", @sorted) ." nextScene:noArg previousScene:noArg"};
|
||||
if( $cmd eq "?" ){ return "Unknown argument ?, choose one of remove:".join(",", @sorted) ." rename save set setcmd scene:".join(",", @sorted) ." n))extScene:noArg previousScene:noArg"};
|
||||
|
||||
if( $cmd eq "save" && !defined( $scene ) ) { return "Usage: set $name save <scene_name>" };
|
||||
if( $cmd eq "scene" && !defined( $scene ) ) { return "Usage: set $name scene <scene_name>" };
|
||||
@ -645,8 +645,13 @@ LightScene_Set($@)
|
||||
my( $index )= grep { $sorted[$_] eq $current } 0..$#sorted;
|
||||
$index = -1 if( !defined($index) );
|
||||
|
||||
Log 1, $index;
|
||||
++$index if( $cmd eq 'nextScene' );
|
||||
--$index if( $cmd eq 'previousScene' );
|
||||
|
||||
return if( $scene && $scene eq 'nowrap' && $index > $#sorted );
|
||||
return if( $scene && $scene eq 'nowrap' && $index < 0 );
|
||||
|
||||
$index = 0 if( $index > $#sorted );
|
||||
$index = $#sorted if( $index < 0 );
|
||||
|
||||
@ -1010,9 +1015,9 @@ LightScene_editTable($) {
|
||||
save current state for alle devices in this LightScene to <scene_name></li>
|
||||
<li>scene <scene_name><br>
|
||||
shows scene <scene_name> - all devices are switched to the previously saved state</li>
|
||||
<li>nextScene<br>
|
||||
<li>nextScene [nowrap]<br>
|
||||
activates the next scene in alphabetical order after the current scene or the first if no current scene is set.</li>
|
||||
<li>previousScene<br>
|
||||
<li>previousScene [nowrap]<br>
|
||||
activates the previous scene in alphabetical order before the current scene or the last if no current scene is set.</li>
|
||||
<li>set <scene_name> <device> [<cmd>]<br>
|
||||
set the saved state of <device> in <scene_name> to <cmd></li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user