37_harmony.pm: added channel command

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@6830 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-10-29 15:46:13 +00:00
parent 47a56c2a54
commit a3c8281b3c

View File

@ -304,6 +304,14 @@ harmony_Set($$@)
harmony_sendEngineGet($hash, "startactivity", "activityId=$param:timestamp=0"); harmony_sendEngineGet($hash, "startactivity", "activityId=$param:timestamp=0");
return undef; return undef;
} elsif( $cmd eq "channel" ) {
return "no current activity" if( !defined($hash->{currentActivityID}) || $hash->{currentActivityID} == -1 );
return "missing channel" if( !$param );
harmony_sendEngineGet($hash, "changeChannel", "channel=$param:timestamp=0");
return undef;
} elsif( $cmd eq "command" ) { } elsif( $cmd eq "command" ) {
my $action; my $action;
@ -494,6 +502,8 @@ harmony_Set($$@)
} }
$list .= " channel" if( defined($hash->{currentActivityID}) && $hash->{currentActivityID} != -1 );
$list .= " command getConfig:noArg getCurrentActivity:noArg off:noArg reconnect:noArg sleeptimer sync:noArg text cursor:up,down,left,right,pageUp,pageDown,home,end special:previousTrack,nextTrack,stop,playPause,volumeUp,volumeDown,mute"; $list .= " command getConfig:noArg getCurrentActivity:noArg off:noArg reconnect:noArg sleeptimer sync:noArg text cursor:up,down,left,right,pageUp,pageDown,home,end special:previousTrack,nextTrack,stop,playPause,volumeUp,volumeDown,mute";
return "Unknown argument $cmd, choose one of $list"; return "Unknown argument $cmd, choose one of $list";
@ -587,7 +597,7 @@ harmony_CDATA2hash($)
$value .= ":". $next; $value .= ":". $next;
} }
$params{$name} = $value; $params{$name} = $value if( $name );
} }
return \%params; return \%params;
@ -913,6 +923,8 @@ harmony_Read($)
harmony_sendEngineGet($hash, "config", ""); harmony_sendEngineGet($hash, "config", "");
} elsif( $content =~ m/engine\?changeChannel/ && $decoded ) {
} elsif( $content =~ m/engine\?gettimerinterval/ && $decoded ) { } elsif( $content =~ m/engine\?gettimerinterval/ && $decoded ) {
$hash->{sleeptimer} = FmtDateTime( gettimeofday() + $decoded->{interval} ); $hash->{sleeptimer} = FmtDateTime( gettimeofday() + $decoded->{interval} );
@ -1571,8 +1583,10 @@ harmony_Attr($$$)
<ul> <ul>
<li>activity &lt;id&gt|&ltname&gt;<br> <li>activity &lt;id&gt|&ltname&gt;<br>
switch to this activity</li> switch to this activity</li>
<li>channel &lt;channel&gt;<br>
switch to &lt;channel&gt; in the current activity</li>
<li>command [&lt;id&gt|&ltname&gt;] &lt;command&gt;<br> <li>command [&lt;id&gt|&ltname&gt;] &lt;command&gt;<br>
send the given ir command for the current activity or for the given device.</li> send the given ir command for the current activity or for the given device</li>
<li>getConfig<br> <li>getConfig<br>
request the configuration from the hub</li> request the configuration from the hub</li>
<li>getCurrentActivity<br> <li>getCurrentActivity<br>