mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 13:26:02 +00:00
37_harmony.pm: some more Development Guidelines AV compatibility
git-svn-id: https://svn.fhem.de/fhem/trunk@6823 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
63c0792be3
commit
9ca1d7e00f
@ -216,6 +216,20 @@ harmony_actionOfCommand($$)
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub
|
||||
harmony_hubOfDevice($)
|
||||
{
|
||||
my ($id) = @_;
|
||||
|
||||
foreach my $d (sort keys %defs) {
|
||||
next if( !defined($defs{$d}) );
|
||||
next if( $defs{$d}->{TYPE} ne "harmony" );
|
||||
next if( $defs{$d}->{id} );
|
||||
next if( !harmony_deviceOfId($defs{$d}, $id) );
|
||||
Log3 undef, 3, "harmony: found IODev $d for device $id" ;
|
||||
return $d;
|
||||
}
|
||||
}
|
||||
|
||||
sub
|
||||
harmony_Set($$@)
|
||||
@ -232,6 +246,13 @@ harmony_Set($$@)
|
||||
return "no hub found for device $name ($param)" if( !$hash->{hub} );
|
||||
}
|
||||
|
||||
if( $cmd ne "?" ) {
|
||||
my $device = harmony_deviceOfId( $defs{$hash->{hub}}, $hash->{id} );
|
||||
if( harmony_actionOfCommand( $device, $cmd ) ) {
|
||||
$param = $cmd;
|
||||
$cmd = "command";
|
||||
}
|
||||
}
|
||||
|
||||
if( $cmd eq "command" ) {
|
||||
$param2 = $param;
|
||||
@ -1259,20 +1280,6 @@ harmony_GetPower($$)
|
||||
return $power;
|
||||
}
|
||||
sub
|
||||
harmony_hubOfDevice($)
|
||||
{
|
||||
my ($id) = @_;
|
||||
|
||||
foreach my $d (sort keys %defs) {
|
||||
next if( !defined($defs{$d}) );
|
||||
next if( $defs{$d}->{TYPE} ne "harmony" );
|
||||
next if( $defs{$d}->{id} );
|
||||
next if( !harmony_deviceOfId($defs{$d}, $id) );
|
||||
Log3 undef, 3, "harmony: found IODev $d for device $id" ;
|
||||
return $d;
|
||||
}
|
||||
}
|
||||
sub
|
||||
harmony_Get($$@)
|
||||
{
|
||||
my ($hash, $name, $cmd, $param) = @_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user