diff --git a/fhem/CHANGED b/fhem/CHANGED index 384009f58..79a16856a 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -51,10 +51,11 @@ - feature: telnet client mode - bugfix: FHEMWEB longpoll misses initial state change (HM: set_on vs. on) - change: 20_OWFS.pm, 21_OWTEMP modules flagged as "deprecated". These - modules will be removed in a future release. Use OWServer / OWDevice - instead. (M. Fischer) + modules will be removed in a future release. Use OWServer / + OWDevice instead. (M. Fischer) - feature: a lot of new features and known 1-wire slaves to OWServer / OWDevice added (M. Fischer) + - feature: set-extensions (additional set commands) for FS20, EnOcean, ZWave - 2012-10-28 (5.3) - feature: added functions trim, ltrim, rtrim, UntoggleDirect, diff --git a/fhem/FHEM/10_EnOcean.pm b/fhem/FHEM/10_EnOcean.pm index e2cb7acdc..20f162c4f 100755 --- a/fhem/FHEM/10_EnOcean.pm +++ b/fhem/FHEM/10_EnOcean.pm @@ -4,6 +4,7 @@ package main; use strict; use warnings; +use SetExtensions; sub EnOcean_Define($$); sub EnOcean_Initialize($); @@ -221,8 +222,10 @@ EnOcean_Set($@) $dimVal=0; } else { - return "Unknown argument $cmd, choose one of dim:slider,0,1,100 ". - "dimup:slider,0,1,100 dimdown:slider,0,1,100 on off teach" + my $list = "dim:slider,0,1,100 dimup:slider,0,1,100 ". + "dimdown:slider,0,1,100 on off teach"; + return SetExtensions($hash, $list, $name, @a); + } if($sendDimCmd) { @@ -288,11 +291,12 @@ EnOcean_Set($@) ########################### } else { # Simulate a PTM my ($c1,$c2) = split(",", $cmd, 2); - return "Unknown argument $cmd, choose one of " . - join(" ", sort keys %EnO_ptm200btn) - if(!defined($EnO_ptm200btn{$c1}) || - ($c2 && !defined($EnO_ptm200btn{$c2}))); - Log $ll2, "EnOcean: set $name $cmd"; + + if(!defined($EnO_ptm200btn{$c1}) || + ($c2 && !defined($EnO_ptm200btn{$c2}))) { + my $list = join(" ", sort keys %EnO_ptm200btn); + return SetExtensions($hash, $list, $name, @a); + } my ($db_3, $status) = split(":", $EnO_ptm200btn{$c1}, 2); $db_3 <<= 5; @@ -636,6 +640,7 @@ EnOcean_A5Cmd($$$) Set diff --git a/fhem/FHEM/10_FS20.pm b/fhem/FHEM/10_FS20.pm index 76ada4b38..0770515b6 100755 --- a/fhem/FHEM/10_FS20.pm +++ b/fhem/FHEM/10_FS20.pm @@ -4,6 +4,7 @@ package main; use strict; use warnings; +use SetExtensions; my %codes = ( "00" => "off", @@ -167,7 +168,7 @@ FS20_Set($@) my $ret = undef; my $na = int(@a); - return "no set value specified" if($na < 2 || $na > 3); + return "no set value specified" if($na < 2); return "Readonly value $a[1]" if(defined($readonly{$a[1]})); if($na > 2 && $a[1] eq "dim") { @@ -181,16 +182,14 @@ FS20_Set($@) if(!defined($c)) { # Model specific set arguments + my $list; if(defined($attr{$name}) && defined($attr{$name}{"model"})) { my $mt = $models{$attr{$name}{"model"}}; - return "Unknown argument $a[1], choose one of " - if($mt && $mt eq "sender"); - return "Unknown argument $a[1], choose one of $fs20_simple" - if($mt && $mt eq "simple"); + $list = "" if($mt && $mt eq "sender"); + $list = $fs20_simple if($mt && $mt eq "simple"); } - return "Unknown argument $a[1], choose one of " . - join(" ", sort keys %fs20_c2b) . - " dim:slider,0,6.25,100"; + $list = join(" ", sort keys %fs20_c2b) if(!defined($list)); + return SetExtensions($hash, $list, @a); } @@ -538,6 +537,8 @@ four2hex($$) toggle # between off and previous dim val on-till # Special, see the note + The set extensions are also supported.
+
Examples:
+ Notes: diff --git a/fhem/docs/commandref_frame_DE.html b/fhem/docs/commandref_frame_DE.html index 3031e4f62..b5fc4d5ad 100644 --- a/fhem/docs/commandref_frame_DE.html +++ b/fhem/docs/commandref_frame_DE.html @@ -800,19 +800,66 @@ Zeilen erstreckende Befehle, indem man keine \ am Zeilenende eingeben muss.