mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
SetExtensions.pm: avoid perl warning when parameters are missing (Forum #116474)
git-svn-id: https://svn.fhem.de/fhem/trunk@23300 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e764329c26
commit
82120a4207
@ -151,11 +151,14 @@ SetExtensions($$@)
|
||||
CommandDefine(undef, "${name}_till at $hms_till set $name $cmd2");
|
||||
|
||||
} elsif($cmd eq "blink") {
|
||||
my $p2 = $a[1];
|
||||
return "$cmd requires 2 numbers as argument"
|
||||
if($param !~ m/^\d+$/ || $p2 !~ m/^\d*\.?\d*$/);
|
||||
my $p2 = $a[1]; # 3rd. parameter is used internally, to spcify the phase
|
||||
return "$cmd requires count as integer and duration as float"
|
||||
if(!defined($param) ||
|
||||
!defined($p2) ||
|
||||
$param !~ m/^\d+$/ ||
|
||||
$p2 !~ m/^\d*\.?\d*$/);
|
||||
|
||||
if($param) {
|
||||
if($param) { # count reached 0
|
||||
delete($hash->{SetExtensionsCommand}) if($param == 1 && $a[2]);
|
||||
SE_DoSet($name, $a[2] ? $offCmd : $onCmd);
|
||||
$param-- if($a[2]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user