mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
use maxNum
git-svn-id: https://svn.fhem.de/fhem/trunk@3424 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7d29c12194
commit
eb481f7867
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user