mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-07 16:59:18 +00:00
30_LIGHTIFY.pm: better autodetection of subType for lightify lamps
git-svn-id: https://svn.fhem.de/fhem/trunk@7979 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e14aefc1b8
commit
3e3e079b99
@ -403,16 +403,6 @@ Log 3, "$alias: $id:$short, type: $type (w:$has_w, rgb:$has_rgb), onoff: $onoff,
|
||||
$cmdret= CommandAttr(undef,"$devname room LIGHTIFY");
|
||||
$cmdret= CommandAttr(undef,"$devname IODev $name");
|
||||
|
||||
my $subtype = 'extcolordimmer';
|
||||
if( $has_w && $has_rgb ) {
|
||||
$subtype = 'extcolordimmer';
|
||||
} elsif( $has_rgb ) {
|
||||
$subtype = 'colordimmer';
|
||||
} elsif( $has_w ) {
|
||||
$subtype = 'ctdimmer';
|
||||
}
|
||||
$cmdret= CommandAttr(undef,"$devname subType $subtype");
|
||||
|
||||
$autocreated++;
|
||||
}
|
||||
}
|
||||
@ -426,6 +416,14 @@ Log 3, "$alias: $id:$short, type: $type (w:$has_w, rgb:$has_rgb), onoff: $onoff,
|
||||
}
|
||||
};
|
||||
|
||||
if( $has_rgb && $has_w ) {
|
||||
$json->{type} = 'Extended color light';
|
||||
} elsif( $has_rgb ) {
|
||||
$json->{type} = 'Color light';
|
||||
} elsif( $has_w ) {
|
||||
$json->{type} = 'Color Temperature Light';
|
||||
}
|
||||
|
||||
if( !$has_rgb ) {
|
||||
$json->{state}->{colormode} = 'ct';
|
||||
|
||||
|
@ -838,8 +838,8 @@ HUEDevice_Parse($$)
|
||||
|
||||
$attr{$name}{model} = $result->{modelid} if( !defined($attr{$name}{model}) && $result->{modelid} );
|
||||
|
||||
if( defined($attr{$name}{model}) ) {
|
||||
if( !defined($attr{$name}{subType}) ) {
|
||||
if( defined($attr{$name}{model}) ) {
|
||||
if( defined($hueModels{$attr{$name}{model}}{subType}) ) {
|
||||
$attr{$name}{subType} = $hueModels{$attr{$name}{model}}{subType};
|
||||
|
||||
@ -852,6 +852,8 @@ HUEDevice_Parse($$)
|
||||
} elsif( $attr{$name}{model} =~ m/RGBW$/ ) {
|
||||
$attr{$name}{subType} = 'extcolordimmer';
|
||||
|
||||
}
|
||||
|
||||
} elsif( $hash->{type} ) {
|
||||
if( $hash->{type} eq "Extended color light" ) {
|
||||
$attr{$name}{subType} = 'extcolordimmer';
|
||||
@ -875,7 +877,6 @@ HUEDevice_Parse($$)
|
||||
} elsif( $attr{$name}{subType} eq "colordimmer" ) {
|
||||
$attr{$name}{subType} = $hueModels{$attr{$name}{model}}{subType} if( defined($hueModels{$attr{$name}{model}}{subType}) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$attr{$name}{devStateIcon} = '{(HUEDevice_devStateIcon($name),"toggle")}' if( !defined( $attr{$name}{devStateIcon} ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user