mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 13:26:02 +00:00
37_harmony.pm: fixed startup racecondition
git-svn-id: https://svn.fhem.de/fhem/trunk@6827 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b6935cabb6
commit
499dc3cf86
@ -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' ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user