From 63c0792be394ffcd2f6e7e2c8981a8bf36439ee6 Mon Sep 17 00:00:00 2001 From: justme-1968 Date: Mon, 27 Oct 2014 20:23:00 +0000 Subject: [PATCH] 37_harmony.pm: allow lower case commands as of Development Guidelines AV git-svn-id: https://svn.fhem.de/fhem/trunk@6822 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/37_harmony.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/37_harmony.pm b/fhem/FHEM/37_harmony.pm index 6d7fb2346..9abe91d03 100644 --- a/fhem/FHEM/37_harmony.pm +++ b/fhem/FHEM/37_harmony.pm @@ -200,9 +200,11 @@ harmony_actionOfCommand($$) my ($device, $command) = @_; return undef if( ref($device) ne "HASH" ); + $command = lc($command); + foreach my $group (@{$device->{controlGroup}}) { foreach my $function (@{$group->{function}}) { - if( $function->{name} eq $command ) { + if( lc($function->{name}) eq $command ) { return decode_json($function->{action}) if( harmony_isFritzBox() ); return JSON->new->utf8(0)->decode($function->{action}); @@ -256,7 +258,7 @@ harmony_Set($$@) return if( $cmd eq "hidDevice" ); } else { - $list = "command hidDevice:noArg text cursor:Up,Down,Left,Right,PageUp,PageDown,Home,End special:PreviousTrack,NextTrack,Stop,PlayPause,VolumeUp,VolumeDown,Mute"; + $list = "command hidDevice: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" if( defined($hash->{id}) ); } @@ -464,7 +466,7 @@ harmony_Set($$@) } - $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"; } @@ -1577,9 +1579,9 @@ harmony_Attr($$$)
  • text <text>
    sends <text> by bluetooth/smart keaboard dongle. a-z ,A-Z ,0-9, \n, \e, \t and space are currently possible
  • cursor <direction>
    - moves the cursor by bluetooth/smart keaboard dongle. <direction> can be one of: Up, Down, Left, Right, PageUp, PageDown, Home, End.
  • + moves the cursor by bluetooth/smart keaboard dongle. <direction> can be one of: up, down, left, right, pageUp, pageDown, home, end.
  • special <key>
    - sends special key by bluetooth/smart keaboard dongle. <key> can be one of: PreviousTrack, NextTrack, Stop, PlayPause, VolumeUp, VolumeDown, Mute.
  • + sends special key by bluetooth/smart keaboard dongle. <key> can be one of: previousTrack, nextTrack, stop, playPause, volumeUp, volumeDown, mute.
  • autocreate [<id>|<name>]
    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.