mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-01 01:09:47 +00:00
31_HUEDevice.pm: ramp time fix for pct 0. see forum: https://forum.fhem.de/index.php/topic,77948.0/
git-svn-id: https://svn.fhem.de/fhem/trunk@15247 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
12e3a8d5dc
commit
6b80281c5b
@ -393,7 +393,10 @@ HUEDevice_SetParam($$@)
|
||||
$cmd = 'bri';
|
||||
}
|
||||
|
||||
$cmd = "off" if($cmd eq "pct" && $value == 0 );
|
||||
if($cmd eq "pct" && $value == 0 ) {
|
||||
$cmd = "off";
|
||||
$value = $value2;
|
||||
}
|
||||
|
||||
if($cmd eq 'on') {
|
||||
$obj->{'on'} = JSON::true;
|
||||
@ -1129,32 +1132,28 @@ HUEDevice_Parse($$)
|
||||
my $s = '';
|
||||
my $pct = -1;
|
||||
my $on = $state->{on}; $readings{on} = $hash->{helper}{onoff} if( !defined($on) );
|
||||
if( $on )
|
||||
{
|
||||
$s = 'on';
|
||||
$readings{onoff} = 1;
|
||||
if( $on ) {
|
||||
$s = 'on';
|
||||
$readings{onoff} = 1;
|
||||
|
||||
if( !defined($readings{bri}) || AttrVal($name, 'subType', 'dimmer') eq 'switch' ) {
|
||||
$pct = 100;
|
||||
|
||||
} else {
|
||||
$pct = int($readings{bri} * 99 / 254 + 1);
|
||||
if( $pct > 0
|
||||
&& $pct < 100 ) {
|
||||
$s = $dim_values{int($pct/7)};
|
||||
}
|
||||
$s = 'off' if( $pct == 0 );
|
||||
if( !defined($readings{bri}) || AttrVal($name, 'subType', 'dimmer') eq 'switch' ) {
|
||||
$pct = 100;
|
||||
|
||||
} else {
|
||||
$pct = int($readings{bri} * 99 / 254 + 1);
|
||||
if( $pct > 0
|
||||
&& $pct < 100 ) {
|
||||
$s = $dim_values{int($pct/7)};
|
||||
}
|
||||
$s = 'off' if( $pct == 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$on = 0;
|
||||
$s = 'off';
|
||||
$pct = 0;
|
||||
} else {
|
||||
$on = 0;
|
||||
$s = 'off';
|
||||
$pct = 0;
|
||||
|
||||
$readings{onoff} = 0;
|
||||
}
|
||||
$readings{onoff} = 0;
|
||||
}
|
||||
|
||||
$readings{pct} = $pct;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user