mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 02:10:32 +00:00
allow groupnr selection for set command
git-svn-id: https://svn.fhem.de/fhem/trunk@1252 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c888595148
commit
9c15c8fe76
@ -160,7 +160,7 @@ EIB_Set($@)
|
|||||||
my $ret = undef;
|
my $ret = undef;
|
||||||
my $na = int(@a);
|
my $na = int(@a);
|
||||||
|
|
||||||
return "no set value specified" if($na < 2 || $na > 3);
|
return "no set value specified" if($na < 2 || $na > 4);
|
||||||
return "Readonly value $a[1]" if(defined($readonly{$a[1]}));
|
return "Readonly value $a[1]" if(defined($readonly{$a[1]}));
|
||||||
return "No $a[1] for dummies" if(IsDummy($hash->{NAME}));
|
return "No $a[1] for dummies" if(IsDummy($hash->{NAME}));
|
||||||
|
|
||||||
@ -170,17 +170,26 @@ EIB_Set($@)
|
|||||||
join(" ", sort keys %eib_c2b);
|
join(" ", sort keys %eib_c2b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# the command can be send to any of the defined groups indexed starting by 1
|
||||||
|
my $groupnr = 1;
|
||||||
|
if($a[1] eq "value" && $na > 3){$groupnr=$a[3]}
|
||||||
|
elsif ($na>2){$groupnr=$a[2]}
|
||||||
|
return "groupnr argument $groupnr must be numeric." if( $groupnr !~ m/[0-9]*/i);
|
||||||
|
return "groupnr $groupnr not known." if(!$hash->{CODE}{$groupnr});
|
||||||
|
|
||||||
my $v = join(" ", @a);
|
my $v = join(" ", @a);
|
||||||
Log GetLogLevel($a[0],2), "EIB set $v";
|
Log GetLogLevel($a[0],2), "EIB set $v";
|
||||||
(undef, $v) = split(" ", $v, 2); # Not interested in the name...
|
(undef, $v) = split(" ", $v, 2); # Not interested in the name...
|
||||||
|
|
||||||
if($a[1] eq "value" && $na == 3) {
|
if($a[1] eq "value" && $na > 2) {
|
||||||
# complex value command.
|
# complex value command.
|
||||||
# the additional argument is transfered alone.
|
# the additional argument is transfered alone.
|
||||||
$c = $a[2];
|
$c = $a[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
IOWrite($hash, "B", "w" . $hash->{GROUP} . $c);
|
my $groupcode = $hash->{CODE}{$groupnr};
|
||||||
|
|
||||||
|
IOWrite($hash, "B", "w" . $groupcode . $c);
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# Delete any timer for on-for_timer
|
# Delete any timer for on-for_timer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user