mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
31_HUEDevice.pm: clear dynamics_status on power off
git-svn-id: https://svn.fhem.de/fhem/trunk@25505 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e0f1073f10
commit
e8a5081096
@ -1952,31 +1952,33 @@ HUEDevice_Parse($$)
|
||||
if( defined($state->{'pct'}) ) {
|
||||
$pct = $state->{'pct'};
|
||||
$s = $pct;
|
||||
} elsif( $on )
|
||||
{
|
||||
$s = 'on';
|
||||
if( $on != $hash->{helper}{on} ) {readingsBulkUpdate($hash,"onoff",1);}
|
||||
|
||||
if( $bri < 0 || AttrVal($name, 'subType', 'dimmer') eq 'switch' ) {
|
||||
$pct = 100;
|
||||
} elsif( $on ) {
|
||||
$s = 'on';
|
||||
if( $on != $hash->{helper}{on} ) {readingsBulkUpdate($hash,"onoff",1);}
|
||||
|
||||
} else {
|
||||
$pct = int($bri * 99 / 254 + 1);
|
||||
if( $pct > 0
|
||||
&& $pct < 100 ) {
|
||||
$s = $dim_values{int($pct/7)};
|
||||
}
|
||||
$s = 'off' if( $pct == 0 );
|
||||
if( $bri < 0 || AttrVal($name, 'subType', 'dimmer') eq 'switch' ) {
|
||||
$pct = 100;
|
||||
|
||||
} else {
|
||||
$pct = int($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;
|
||||
if( $on != $hash->{helper}{on} ) {readingsBulkUpdate($hash,"onoff",0);}
|
||||
}
|
||||
} else {
|
||||
$on = 0;
|
||||
$s = 'off';
|
||||
$pct = 0;
|
||||
if( $on != $hash->{helper}{on} ) {readingsBulkUpdate($hash,"onoff",0);}
|
||||
}
|
||||
|
||||
$readings{dynamics_status} = 'none' if( !$on && defined($hash->{helper}{dynamics_status}) && !defined($readings{dynamics_status}) );
|
||||
|
||||
if( $pct != $hash->{helper}{pct} ) {readingsBulkUpdate($hash,"pct", $pct);}
|
||||
#if( $pct != $hash->{helper}{pct} ) {readingsBulkUpdate($hash,"level", $pct . ' %');}
|
||||
|
Loading…
x
Reference in New Issue
Block a user