diff --git a/FHEM/31_HUEDevice.pm b/FHEM/31_HUEDevice.pm index 62338b682..91744a520 100644 --- a/FHEM/31_HUEDevice.pm +++ b/FHEM/31_HUEDevice.pm @@ -197,15 +197,6 @@ sub HUEDevice_Undefine($$) return undef; } -sub -HUEDevice_max($@) -{ - my ($max, @vars) = @_; - for (@vars) { - $max = $_ if $_ > $max; - } - return $max; -} sub HUEDevice_SetParam($$@) { @@ -282,7 +273,7 @@ HUEDevice_SetParam($$@) #$y = 1 if( $y > 1 ); $Y = 1 if( $Y > 1 ); - my $bri = HUEDevice_max($r,$g,$b); + my $bri = maxNum($r,$g,$b); #my $bri = $Y; $obj->{'on'} = JSON::true; @@ -411,7 +402,7 @@ xyYtorgb($$$) if( $X > 1 || $Y > 1 || $Z > 1 ) { - my $f = HUEDevice_max($X,$Y,$Z); + my $f = maxNum($X,$Y,$Z); $X /= $f; $Y /= $f; $Z /= $f; @@ -425,7 +416,7 @@ xyYtorgb($$$) if( $r > 1 || $g > 1 || $b > 1 ) { - my $f = HUEDevice_max($r,$g,$b); + my $f = maxNum($r,$g,$b); $r /= $f; $g /= $f; $b /= $f;