2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

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 44ff7bcb84
commit a63ee299b5
2 changed files with 3 additions and 4 deletions

View File

@ -407,7 +407,7 @@ sub HMCCUCHN_Set ($@)
}
elsif ($opt eq 'config') {
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);
return HMCCU_SetError ($hash, $rc) if ($rc < 0);

View File

@ -475,12 +475,11 @@ sub HMCCUDEV_Set ($@)
}
}
elsif ($opt eq 'config') {
return HMCCU_SetError ($hash, "Usage: set $name config [{channel-number}] {parameter}={value} [...]")
if (scalar (keys %{$h}) < 1);
return HMCCU_SetError ($hash, "Usage: set $name config [{channel-number}] {parameter}={value} [...]") if ((scalar keys %{$h}) < 1);
my $objname = $ccuaddr;
# 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});
$objname .= ':'.$1;
}