mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 10:46:03 +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 room LIGHTIFY");
|
||||||
$cmdret= CommandAttr(undef,"$devname IODev $name");
|
$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++;
|
$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 ) {
|
if( !$has_rgb ) {
|
||||||
$json->{state}->{colormode} = 'ct';
|
$json->{state}->{colormode} = 'ct';
|
||||||
|
|
||||||
|
@ -838,8 +838,8 @@ HUEDevice_Parse($$)
|
|||||||
|
|
||||||
$attr{$name}{model} = $result->{modelid} if( !defined($attr{$name}{model}) && $result->{modelid} );
|
$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}{subType}) ) {
|
if( defined($attr{$name}{model}) ) {
|
||||||
if( defined($hueModels{$attr{$name}{model}}{subType}) ) {
|
if( defined($hueModels{$attr{$name}{model}}{subType}) ) {
|
||||||
$attr{$name}{subType} = $hueModels{$attr{$name}{model}}{subType};
|
$attr{$name}{subType} = $hueModels{$attr{$name}{model}}{subType};
|
||||||
|
|
||||||
@ -852,29 +852,30 @@ HUEDevice_Parse($$)
|
|||||||
} elsif( $attr{$name}{model} =~ m/RGBW$/ ) {
|
} elsif( $attr{$name}{model} =~ m/RGBW$/ ) {
|
||||||
$attr{$name}{subType} = 'extcolordimmer';
|
$attr{$name}{subType} = 'extcolordimmer';
|
||||||
|
|
||||||
} elsif( $hash->{type} ) {
|
}
|
||||||
if( $hash->{type} eq "Extended color light" ) {
|
|
||||||
$attr{$name}{subType} = 'extcolordimmer';
|
|
||||||
|
|
||||||
} elsif( $hash->{type} eq "Color light" ) {
|
} elsif( $hash->{type} ) {
|
||||||
$attr{$name}{subType} = 'colordimmer';
|
if( $hash->{type} eq "Extended color light" ) {
|
||||||
|
$attr{$name}{subType} = 'extcolordimmer';
|
||||||
|
|
||||||
} elsif( $hash->{type} eq "Color Temperature Light" ) {
|
} elsif( $hash->{type} eq "Color light" ) {
|
||||||
$attr{$name}{subType} = 'ctdimmer';
|
$attr{$name}{subType} = 'colordimmer';
|
||||||
|
|
||||||
} elsif( $hash->{type} eq "Dimmable light" ) {
|
} elsif( $hash->{type} eq "Color Temperature Light" ) {
|
||||||
$attr{$name}{subType} = 'dimmer';
|
$attr{$name}{subType} = 'ctdimmer';
|
||||||
|
|
||||||
} elsif( $hash->{type} eq "Dimmable plug-in unit" ) {
|
} elsif( $hash->{type} eq "Dimmable light" ) {
|
||||||
$attr{$name}{subType} = 'dimmer';
|
$attr{$name}{subType} = 'dimmer';
|
||||||
|
|
||||||
}
|
} elsif( $hash->{type} eq "Dimmable plug-in unit" ) {
|
||||||
|
$attr{$name}{subType} = 'dimmer';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} elsif( $attr{$name}{subType} eq "colordimmer" ) {
|
|
||||||
$attr{$name}{subType} = $hueModels{$attr{$name}{model}}{subType} if( defined($hueModels{$attr{$name}{model}}{subType}) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} elsif( $attr{$name}{subType} eq "colordimmer" ) {
|
||||||
|
$attr{$name}{subType} = $hueModels{$attr{$name}{model}}{subType} if( defined($hueModels{$attr{$name}{model}}{subType}) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user