mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 07:56:03 +00:00
reapplied 'fix for '\(255 x @channels)' expanding to a string instead of an array' fix
git-svn-id: https://svn.fhem.de/fhem/trunk@4407 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
95e2ac9863
commit
233485fe50
@ -131,16 +131,15 @@ ChannelsToBrightness(@) {
|
|||||||
$max = $value if ($max < $value);
|
$max = $value if ($max < $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
|
||||||
bri => 0,
|
|
||||||
channels => \(255 x @channels),
|
|
||||||
} unless ($max > 0);
|
|
||||||
|
|
||||||
my @bri = ();
|
my @bri = ();
|
||||||
|
if( $max == 0) {
|
||||||
|
@bri = (0) x @channels;
|
||||||
|
} else {
|
||||||
my $norm = 255/$max;
|
my $norm = 255/$max;
|
||||||
foreach my $value (@channels) {
|
foreach my $value (@channels) {
|
||||||
push @bri,int($value*$norm);
|
push @bri,int($value*$norm);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
bri => int($max/2.55),
|
bri => int($max/2.55),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user