From 499dc3cf86b48b52e88d834750e40be4a8087184 Mon Sep 17 00:00:00 2001 From: justme-1968 Date: Tue, 28 Oct 2014 14:26:33 +0000 Subject: [PATCH] 37_harmony.pm: fixed startup racecondition git-svn-id: https://svn.fhem.de/fhem/trunk@6827 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/37_harmony.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/37_harmony.pm b/fhem/FHEM/37_harmony.pm index b240a58de..a82eeff33 100644 --- a/fhem/FHEM/37_harmony.pm +++ b/fhem/FHEM/37_harmony.pm @@ -176,6 +176,8 @@ harmony_labelOfDevice($$;$) { my ($hash, $id, $default) = @_; + return undef if( !defined($hash->{config}) ); + foreach my $device (@{$hash->{config}->{device}}) { return $device->{label} if( $device->{id} == $id ); } @@ -187,6 +189,8 @@ harmony_deviceOfId($$) { my ($hash, $id) = @_; + return undef if( !defined($hash->{config}) ); + foreach my $device (@{$hash->{config}->{device}}) { return $device if( $device->{id} == $id ); } @@ -241,9 +245,9 @@ harmony_Set($$@) my $list = ""; if( defined($hash->{id}) ) { if( !$hash->{hub} ) { - $hash->{hub} = harmony_hubOfDevice($param); + $hash->{hub} = harmony_hubOfDevice($hash->{id}); - return "no hub found for device $name ($param)" if( !$hash->{hub} ); + return "no hub found for device $name ($hash->{id})" if( !$hash->{hub} ); } if( $cmd ne "?" ) { @@ -682,7 +686,6 @@ sub harmony_char2hid($) { my ($char) = @_; -Log 1, $char; my $ret; if( $char ge '1' && $char le '9' ) {