2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

allow multiparam get

git-svn-id: https://svn.fhem.de/fhem/trunk@4551 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-01-03 21:09:58 +00:00
parent 75fbc64233
commit cae105747e

View File

@ -375,7 +375,7 @@ SWAP_Set($@)
if( $cmd ne '?' ) {
if( my @a = grep( $_ =~ /^$cmd($|:)/, keys %{$sl} ) ) {
return "set $cmd requires $sl->{$a[0]} parameter(s)" if( $sl->{$a[0]} != -99 && $sl->{$a[0]} != $cnt-1 );
return "set $cmd requires $sl->{$a[0]} parameter(s)" if( defined($sl->{$cmd}) && $sl->{$cmd} != $cnt-1 );
if( my $set = $modules{$hash->{TYPE}}{SWAP_SetFn} ) {
no strict "refs";
@ -393,7 +393,7 @@ SWAP_Set($@)
foreach my $cmd ( sort keys ( %{$sl} ) ) {
$list .= " ";
$list .= $cmd;
$list .= ":noArg" if( !$sl->{$cmd} );
$list .= ":noArg" if( defined($sl->{$cmd}) && !$sl->{$cmd} );
}
#$list .= " " . join(" ", sort keys %{$sl});
}
@ -634,8 +634,8 @@ SWAP_Get($@)
if( my $gl = $modules{$hash->{TYPE}}{SWAP_GetList} ) {
if(defined($gl->{$cmd}) ) {
return "get $cmd requires $gl->{$cmd} parameter(s)" if( $gl->{$cmd} != int(@args) );
if(exists($gl->{$cmd}) ) {
return "get $cmd requires $gl->{$cmd} parameter(s)" if( defined($gl->{$cmd}) && $gl->{$cmd} != int(@args) );
if( my $get = $modules{$hash->{TYPE}}{SWAP_GetFn} ) {
no strict "refs";
@ -649,7 +649,7 @@ SWAP_Get($@)
foreach my $cmd ( sort keys ( %{$gl} ) ) {
$list .= " ";
$list .= $cmd;
$list .= ":noArg" if( !$gl->{$cmd} );
$list .= ":noArg" if( defined($gl->{$cmd}) && !$gl->{$cmd} );
}
#$list .= " " . join(" ", sort keys %{$gl});
}