HMCCU: Fixed bugs in HMCCUCHN and HMCCUDEV

git-svn-id: https://svn.fhem.de/fhem/trunk@13060 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
zap
2017-01-13 18:45:13 +00:00
parent 9d09129b31
commit f24b46a92f
2 changed files with 3 additions and 4 deletions

View File

@@ -407,7 +407,7 @@ sub HMCCUCHN_Set ($@)
} }
elsif ($opt eq 'config') { elsif ($opt eq 'config') {
return HMCCU_SetError ($hash, "Usage: set $name config {parameter}={value} [...]") return HMCCU_SetError ($hash, "Usage: set $name config {parameter}={value} [...]")
if (scalar (keys %{$h}) < 1); if ((scalar keys %{$h}) < 1);
my $rc = HMCCU_RPCSetConfig ($hash, $ccuaddr, $h); my $rc = HMCCU_RPCSetConfig ($hash, $ccuaddr, $h);
return HMCCU_SetError ($hash, $rc) if ($rc < 0); return HMCCU_SetError ($hash, $rc) if ($rc < 0);

View File

@@ -475,12 +475,11 @@ sub HMCCUDEV_Set ($@)
} }
} }
elsif ($opt eq 'config') { elsif ($opt eq 'config') {
return HMCCU_SetError ($hash, "Usage: set $name config [{channel-number}] {parameter}={value} [...]") return HMCCU_SetError ($hash, "Usage: set $name config [{channel-number}] {parameter}={value} [...]") if ((scalar keys %{$h}) < 1);
if (scalar (keys %{$h}) < 1);
my $objname = $ccuaddr; my $objname = $ccuaddr;
# Channel number is optional because parameter can be related to device or channel # Channel number is optional because parameter can be related to device or channel
if (scalar (@$a) > 0) && $$a[0] =~ /^([0-9]{1,2})$/) { if ((scalar @$a) > 0 && $$a[0] =~ /^([0-9]{1,2})$/) {
return HMCCU_SetError ($hash, -7) if ($1 >= $hash->{channels}); return HMCCU_SetError ($hash, -7) if ($1 >= $hash->{channels});
$objname .= ':'.$1; $objname .= ':'.$1;
} }