2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

31_HUEDevice.pm: update lights in group after set group ...

git-svn-id: https://svn.fhem.de/fhem/trunk@7315 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-12-23 18:26:56 +00:00
parent effe1db3dc
commit 0b9effc21c

View File

@ -481,6 +481,7 @@ HUEDevice_Set($@)
if( scalar keys %obj ) {
my $result;
if( $hash->{helper}->{group} ) {
$hash->{helper}->{update} = 1;
$result = HUEDevice_ReadFromServer($hash,$hash->{ID}."/action",\%obj);
} else {
$result = HUEDevice_ReadFromServer($hash,$hash->{ID}."/state",\%obj);
@ -765,20 +766,23 @@ HUEDevice_Parse($$)
my $name = $hash->{NAME};
Log3 $name, 4, "parse status message for $name";
#Log3 $name, 5, Dumper $result;
$hash->{name} = $result->{'name'};
$hash->{type} = $result->{'type'};
if( $hash->{helper}->{group} ) {
$hash->{lights} = join( ",", @{$result->{lights}} );
$hash->{lights} = join( ",", @{$result->{lights}} ) if( $result->{lights} );
foreach my $id ( @{$result->{lights}} ) {
my $code = $hash->{IODev}->{NAME} ."-". $id;
my $chash = $modules{HUEDevice}{defptr}{$code};
#HUEDevice_GetUpdate($chash) if( defined($chash) );
HUEDevice_GetUpdate($chash) if( defined($chash) && defined($hash->{helper}->{update}) );
}
delete $hash->{helper}->{update};
return undef;
}