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

30_HUEBridge.pm: deConz scene fix

git-svn-id: https://svn.fhem.de/fhem/trunk@20684 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2019-12-08 10:13:15 +00:00
parent 99600ba853
commit 80770e7144

View File

@ -498,6 +498,7 @@ HUEBridge_string2array($)
sub
HUEBridge_scene2id($$)
{
# hash is the bridge device
my ($hash,$id) = @_;
$hash = $defs{$hash} if( ref($hash) ne 'HASH' );
return undef if( !$hash );
@ -506,13 +507,13 @@ HUEBridge_scene2id($$)
$id = $1;
}
if( $hash->{helper}{scenes} ) {
if( my $scenes = $hash->{helper}{scenes} ) {
return $id if( defined($hash->{helper}{scenes}{$id}) );
$id = lc($id);
$id =~ s/\((.*)\)$/\\\($1\\\)/;
foreach my $key ( keys %{$hash->{helper}{scenes}} ) {
my $scene = $hash->{helper}{scenes}{$key};
foreach my $key ( keys %{$scenes} ) {
my $scene = $scenes->{$key};
return $key if( lc($key) eq $id );
#return $key if( $scene->{name} eq $id );
@ -525,6 +526,7 @@ HUEBridge_scene2id($$)
sub
HUEBridge_scene2id_deCONZ($$)
{
# hash is the client device
my ($hash,$id) = @_;
my $name = $hash->{NAME};
#Log3 $name, 4, "HUEBridge_scene2id_deCONZ: $id, hash: " . Dumper $hash;
@ -535,7 +537,7 @@ HUEBridge_scene2id_deCONZ($$)
$id = $1;
}
if( my $scenes = $hash->{scenes} ) {
if( my $scenes = $hash->{helper}{scenes} ) {
$id = lc($id);
$id =~ s/\((.*)\)$/\\\($1\\\)/;
for my $scene ( @{$scenes} ) {