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