10_ZWave.pm: Checking the rgb parameter

git-svn-id: https://svn.fhem.de/fhem/trunk@8431 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2015-04-13 17:44:27 +00:00
parent b8ebcde7af
commit 99abbfa9d2

View File

@@ -449,7 +449,7 @@ ZWave_Cmd($$@)
}
if($type eq "set" && $cmd eq "rgb") {
if($a[0] =~ m/0-9A-F/i && $a[0] =~ /^(..)(..)(..)$/) {
if($a[0] && $a[0] =~ m/^[0-9A-F]+$/i && $a[0] =~ /^(..)(..)(..)$/) {
@a = (hex($1), hex($2), hex($3));
} else {
return "set rgb: a 6-digit hex number is required";