mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 10:46:03 +00:00
31_HUEDevice.pm: create .associatedWith
git-svn-id: https://svn.fhem.de/fhem/trunk@25444 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
169e759800
commit
cb362fbc7c
@ -1491,10 +1491,25 @@ HUEDevice_Parse($$)
|
|||||||
|
|
||||||
if( $result->{lights} ) {
|
if( $result->{lights} ) {
|
||||||
$hash->{helper}{lights} = {map {$_=>1} @{$result->{lights}}};
|
$hash->{helper}{lights} = {map {$_=>1} @{$result->{lights}}};
|
||||||
$hash->{lights} = join( ",", sort { $a <=> $b } @{$result->{lights}} );
|
my $lights = join( ",", sort { $a <=> $b } @{$result->{lights}} );
|
||||||
|
if( $lights ne $hash->{lights} ) {
|
||||||
|
$hash->{lights} = $lights;
|
||||||
|
|
||||||
|
my $lights = join (' ', map( { my $code = $_;
|
||||||
|
$code = $hash->{IODev}->{NAME} ."-". $code if( defined($hash->{IODev}) );
|
||||||
|
$modules{HUEDevice}{defptr}{$code}{NAME} } @{$result->{lights}}) );
|
||||||
|
#readingsSingleUpdate($hash,"rgb", $rgb,1);
|
||||||
|
setReadingsVal( $hash, ".associatedWith", $lights, TimeNow() );
|
||||||
|
}
|
||||||
|
|
||||||
|
} elsif( defined($result->{lights}) ) {
|
||||||
|
$hash->{lights} = '';
|
||||||
|
$hash->{helper}{lights} = {};
|
||||||
|
CommandDeleteReading( undef, "$name .associatedWith" );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
#$hash->{helper}{lights} = {};
|
|
||||||
#$hash->{lights} = '';
|
#$hash->{lights} = '';
|
||||||
|
#$hash->{helper}{lights} = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ref($result->{state}) eq 'HASH' ) {
|
if( ref($result->{state}) eq 'HASH' ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user