2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

30_HUEBridge.pm: better error checking

git-svn-id: https://svn.fhem.de/fhem/trunk@13710 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2017-03-15 12:17:49 +00:00
parent 3a616fab8f
commit 068a41fef3

View File

@ -968,10 +968,11 @@ sub HUEBridge_ProcessResponse($$)
} elsif( $l[1] eq 'groups' && $l[3] eq 'action' ) {
my $code = $name ."-G". $l[2];
my $d = $modules{HUEDevice}{defptr}{$code};
my $lights = $d->{lights};
foreach my $light ( split(',', $lights) ) {
$json{$light}->{state}->{$l[4]} = $success->{$key};
$successes++;
if( my $lights = $d->{lights} ) {
foreach my $light ( split(',', $lights) ) {
$json{$light}->{state}->{$l[4]} = $success->{$key};
$successes++;
}
}
}