mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 01:46:08 +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,15 +131,14 @@ ChannelsToBrightness(@) {
|
||||
$max = $value if ($max < $value);
|
||||
}
|
||||
|
||||
return {
|
||||
bri => 0,
|
||||
channels => \(255 x @channels),
|
||||
} unless ($max > 0);
|
||||
|
||||
my @bri = ();
|
||||
my $norm = 255/$max;
|
||||
foreach my $value (@channels) {
|
||||
push @bri,int($value*$norm);
|
||||
if( $max == 0) {
|
||||
@bri = (0) x @channels;
|
||||
} else {
|
||||
my $norm = 255/$max;
|
||||
foreach my $value (@channels) {
|
||||
push @bri,int($value*$norm);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user