diff --git a/fhem/CHANGED b/fhem/CHANGED index 8554fb1eb..35b8e8a70 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: sequence: triggerPartial Attribute added - feature: 36_JeeLink: changed flash command to use fhem firmware directory (by HCS) - feature: 70_ENIGMA2: new attribute lightMode for old/slow devices diff --git a/fhem/FHEM/91_sequence.pm b/fhem/FHEM/91_sequence.pm index f30b0b367..f9a529483 100755 --- a/fhem/FHEM/91_sequence.pm +++ b/fhem/FHEM/91_sequence.pm @@ -15,7 +15,7 @@ sequence_Initialize($) $hash->{DefFn} = "sequence_Define"; $hash->{UndefFn} = "sequence_Undef"; $hash->{NotifyFn} = "sequence_Notify"; - $hash->{AttrList} = "disable:0,1"; + $hash->{AttrList} = "disable:0,1 triggerPartial:0,1"; } @@ -103,8 +103,10 @@ sequence_Trigger($) my $hash = $defs{$ln}; my @d = split("[ \t]+", $hash->{DEF}); $hash->{RE} = $d[0]; + my $idx = $hash->{IDX}/2; $hash->{IDX} = 0; - Log3 $ln, 5, "sequence $ln timeout"; + Log3 $ln, 5, "sequence $ln timeout on $idx"; + DoTrigger($ln, "partial_$idx") if(AttrVal($ln, "triggerPartial", undef)); } sub @@ -128,7 +130,8 @@ sequence_Undef($$) Define
define <name> sequence <re1> <timeout1> <re2> [<timeout2> <re3> ...]
+ define <name> sequence <re1> <timeout1>
+ <re2> [<timeout2> <re3> ...]
+ fhem> define seq sequence d1:on 1 d1:on 1 d1:on
+ fhem> attr seq triggerPartial
+ fhem> set d1 on;; sleep 0.5;; set d1 on
+
+ generates the event seq partial_2. This can be used to assign different
+ tasks for a single button, depending on the number of times it is
+ pressed.
+ define <name> sequence <re1> <timeout1>
+ <re2> [<timeout2> <re3> ...]
+
+ define lampseq sequence Btn1:on 0.5 Btn2:off 0.5 Btn1:on
+ define lampon notify lampseq:trigger set lamp on
+
+
+ fhem> define seq sequence d1:on 1 d1:on 1 d1:on
+ fhem> attr seq triggerPartial
+ fhem> set d1 on;; sleep 0.5;; set d1 on
+
+ erzeugt das Event "seq partial_2". Dies kann verwendet werden, um z.Bsp.
+ einer Taste unterschiedliche Aufgaben zuzuweisen, jenachdem wie oft sie
+ gedrückt wurde.
+