mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
37_harmony.pm: fix for acces to uninitialized device data
git-svn-id: https://svn.fhem.de/fhem/trunk@8751 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9f7f26bd62
commit
de0ed6de6c
@ -533,11 +533,13 @@ harmony_Set($$@)
|
|||||||
return undef if( !defined($hash->{config}) );
|
return undef if( !defined($hash->{config}) );
|
||||||
|
|
||||||
my $activities;
|
my $activities;
|
||||||
|
if( $hash->{config}->{activity} ) {
|
||||||
foreach my $activity (sort { ($a->{activityOrder}||0) <=> ($b->{activityOrder}||0) } @{$hash->{config}->{activity}}) {
|
foreach my $activity (sort { ($a->{activityOrder}||0) <=> ($b->{activityOrder}||0) } @{$hash->{config}->{activity}}) {
|
||||||
next if( $activity->{id} == -1 );
|
next if( $activity->{id} == -1 );
|
||||||
$activities .= "," if( $activities );
|
$activities .= "," if( $activities );
|
||||||
$activities .= $activity->{label};
|
$activities .= $activity->{label};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( my $activity = harmony_activityOfId($hash, -1) ) {
|
if( my $activity = harmony_activityOfId($hash, -1) ) {
|
||||||
$activities .= "," if( $activities );
|
$activities .= "," if( $activities );
|
||||||
@ -552,6 +554,7 @@ harmony_Set($$@)
|
|||||||
|
|
||||||
my $hidDevices;
|
my $hidDevices;
|
||||||
my $autocreateDevices;
|
my $autocreateDevices;
|
||||||
|
if( $hash->{config}->{device} ) {
|
||||||
foreach my $device (sort { $a->{id} <=> $b->{id} } @{$hash->{config}->{device}}) {
|
foreach my $device (sort { $a->{id} <=> $b->{id} } @{$hash->{config}->{device}}) {
|
||||||
if( $device->{IsKeyboardAssociated} ) {
|
if( $device->{IsKeyboardAssociated} ) {
|
||||||
$hidDevices .= "," if( $hidDevices );
|
$hidDevices .= "," if( $hidDevices );
|
||||||
@ -563,6 +566,7 @@ harmony_Set($$@)
|
|||||||
$autocreateDevices .= harmony_labelOfDevice($hash, $device->{id} );
|
$autocreateDevices .= harmony_labelOfDevice($hash, $device->{id} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( $hidDevices ) {
|
if( $hidDevices ) {
|
||||||
$hidDevices =~ s/ /./g;
|
$hidDevices =~ s/ /./g;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user