2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 10:46:53 +00:00

10_RHASSPY: fix crash with Hue commands

git-svn-id: https://svn.fhem.de/fhem/trunk@25803 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2022-03-09 09:15:37 +00:00
parent d8a8ad342c
commit f58f999b15

View File

@ -4562,7 +4562,7 @@ sub _runSetColorCmd {
return respond( $hash, $data, $error ) if $error;
return getResponse($hash, 'DefaultConfirmation');
} elsif ( defined $data->{$kw} && defined $mapping->{$_} ) {
my $value = _round( ( $mapping->{$_}->{maxVal} - $mapping->{$_}->{minVal} ) * $data->{$kw} / $kw eq 'Hue' ? 360 : 100 ) ;
my $value = _round( ( $mapping->{$_}->{maxVal} - $mapping->{$_}->{minVal} ) * $data->{$kw} / ( $kw eq 'Hue' ? 360 : 100 ) ) ;
$value = min(max($mapping->{$_}->{minVal}, $value), $mapping->{$_}->{maxVal});
$error = AnalyzeCommand($hash, "set $device $mapping->{$_}->{cmd} $value");
return if $inBulk;