mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-15 04:20:56 +00:00
37_harmony.pm: added optional <channel> paramter to set activity command
git-svn-id: https://svn.fhem.de/fhem/trunk@9899 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4254cf3ffb
commit
5f626f8cba
@ -351,8 +351,12 @@ harmony_Set($$@)
|
||||
|
||||
harmony_sendEngineGet($hash, "startactivity", "activityId=$param:timestamp=0");
|
||||
|
||||
delete $hash->{channelAfterStart};
|
||||
$hash->{channelAfterStart} = $param2 if( $param2 );
|
||||
|
||||
return undef;
|
||||
} elsif( $cmd eq "channel" ) {
|
||||
delete $hash->{channelAfterStart};
|
||||
return "no current activity" if( !defined($hash->{currentActivityID}) || $hash->{currentActivityID} == -1 );
|
||||
|
||||
my $activity = harmony_activityOfId($hash, $hash->{currentActivityID});
|
||||
@ -832,7 +836,11 @@ harmony_updateActivity($$;$)
|
||||
readingsSingleUpdate( $hash, "currentActivity", "$modifier$activity", 1 );
|
||||
|
||||
$activity =~ s/ /./g;
|
||||
readingsSingleUpdate( $hash, "activity", $activity, 1 ) if( !$modifier && $activity ne ReadingsVal($hash->{NAME},"activity", "" ) );
|
||||
if( !$modifier && $activity ne ReadingsVal($hash->{NAME},"activity", "" ) ) {
|
||||
readingsSingleUpdate( $hash, "activity", $activity, 1 );
|
||||
|
||||
harmony_sendEngineGet($hash, "changeChannel", "channel=$hash->{channelAfterStart}:timestamp=0") if( $hash->{channelAfterStart} );
|
||||
}
|
||||
|
||||
delete $hash->{hidDevice} if( $id == -1 );
|
||||
}
|
||||
@ -1640,20 +1648,20 @@ harmony_Get($$@)
|
||||
if( $cmd eq 'showAccount' ) {
|
||||
my $user = $hash->{helper}{username};
|
||||
my $password = $hash->{helper}{password};
|
||||
|
||||
|
||||
return 'no user set' if( !$user );
|
||||
return 'no password set' if( !$password );
|
||||
|
||||
|
||||
$user = harmony_decrypt( $user );
|
||||
$password = harmony_decrypt( $password );
|
||||
|
||||
|
||||
return "user: $user\npassword: $password";
|
||||
}
|
||||
$list .= " showAccount";
|
||||
|
||||
$list .= " currentActivity:noArg";
|
||||
|
||||
$list =~ s/^ //;
|
||||
$list =~ s/^ //;
|
||||
return "Unknown argument $cmd, choose one of $list";
|
||||
}
|
||||
|
||||
@ -1789,11 +1797,11 @@ harmony_decrypt($)
|
||||
<a name="harmony_Set"></a>
|
||||
<b>Set</b>
|
||||
<ul>
|
||||
<li>activity <id>|<name><br>
|
||||
switch to this activity</li>
|
||||
<li>activity <id>|<name> [<channel>]<br>
|
||||
switch to this activit and optionally switch to <channel></li>
|
||||
<li>channel <channel><br>
|
||||
switch to <channel> in the current activity</li>
|
||||
<li>command [<id>|<name>] <command><br>
|
||||
<li>command [<id>|<name>] <command><br>
|
||||
send the given ir command for the current activity or for the given device</li>
|
||||
<li>getConfig<br>
|
||||
request the configuration from the hub</li>
|
||||
@ -1809,7 +1817,7 @@ harmony_decrypt($)
|
||||
default -> 60 minutes</li>
|
||||
<li>sync<br>
|
||||
syncs the hub to the myHarmony config</li>
|
||||
<li>hidDevice [<id>|<name>]<br>
|
||||
<li>hidDevice [<id>|<name>]<br>
|
||||
sets the target device for keyboard commands, if no device is given -> set the target to the
|
||||
default device for the current activity.</li>
|
||||
<li>text <text><br>
|
||||
@ -1818,13 +1826,13 @@ harmony_decrypt($)
|
||||
moves the cursor by bluetooth/smart keaboard dongle. <direction> can be one of: up, down, left, right, pageUp, pageDown, home, end.</li>
|
||||
<li>special <key><br>
|
||||
sends special key by bluetooth/smart keaboard dongle. <key> can be one of: previousTrack, nextTrack, stop, playPause, volumeUp, volumeDown, mute.</li>
|
||||
<li>autocreate [<id>|<name>]<br>
|
||||
<li>autocreate [<id>|<name>]<br>
|
||||
creates a fhem device for a single/all device(s) in the harmony hub. if activities are startet the state
|
||||
of these devices will be updatet with the power state defined in these activites.</li>
|
||||
<li>update<br>
|
||||
triggers a firmware update. only available if a new firmware is available.</li>
|
||||
</ul>
|
||||
The command, hidDevice, text, cursor and special commmands are also available for the autocreated devices. The <id>|<name> paramter hast to be omitted.<br><br>
|
||||
The command, hidDevice, text, cursor and special commmands are also available for the autocreated devices. The <id>|<name> paramter hast to be omitted.<br><br>
|
||||
|
||||
<a name="harmony_Get"></a>
|
||||
<b>Get</b>
|
||||
@ -1846,7 +1854,7 @@ harmony_decrypt($)
|
||||
<li>showAccount<br>
|
||||
display obfuscated user and password in cleartext</li>
|
||||
</ul>
|
||||
The commands commmand is also available for the autocreated devices. The <id>|<name> paramter hast to be omitted.<br><br>
|
||||
The commands commmand is also available for the autocreated devices. The <id>|<name> paramter hast to be omitted.<br><br>
|
||||
|
||||
|
||||
<a name="harmony_Attr"></a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user