add takepicture and attribut takepicturesolution

This commit is contained in:
Marko Oldenburg 2018-01-05 22:12:03 +01:00
parent da57837fc7
commit 4ed0511418
2 changed files with 13 additions and 4 deletions

View File

@ -75,7 +75,7 @@ eval "use JSON;1" or $missingModul .= "JSON ";
my $modulversion = "4.0.8"; my $modulversion = "4.0.8";
my $flowsetversion = "4.0.12"; my $flowsetversion = "4.0.13";

View File

@ -58,8 +58,8 @@ eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode ";
eval "use JSON;1" or $missingModul .= "JSON "; eval "use JSON;1" or $missingModul .= "JSON ";
my $modulversion = "4.0.12"; my $modulversion = "4.0.13";
my $flowsetversion = "4.0.12"; my $flowsetversion = "4.0.13";
@ -121,6 +121,7 @@ sub AMADDevice_Initialize($) {
"root:0,1 ". "root:0,1 ".
"disable:1 ". "disable:1 ".
"remoteServer:Automagic,Autoremote,TNES,other ". "remoteServer:Automagic,Autoremote,TNES,other ".
"setTakePictureResolution:800x600,1024x768,1280x720,1600x1200,1920x1080 ".
"IODev ". "IODev ".
$readingFnAttributes; $readingFnAttributes;
@ -630,6 +631,14 @@ sub AMADDevice_Set($$@) {
$method = "POST"; $method = "POST";
} }
elsif( lc $cmd eq 'takepicture' ) {
return "Please set \"setTakePictureResolution\" Attribut first"
unless(AttrVal($name,'setTakePictureResolution','none') ne 'none');
$uri = $host . ":" . $port . "/fhem-amad/setCommands/takepicture?pictureresolution=" . AttrVal($name,'setTakePictureResolution','none');
$method = "POST";
}
elsif( lc $cmd eq 'sendintent' ) { elsif( lc $cmd eq 'sendintent' ) {
my $intentstring = join( " ", @args ); my $intentstring = join( " ", @args );
my ( $action, $exkey1, $exval1, $exkey2, $exval2 ) = split( "[ \t][ \t]*", $intentstring ); my ( $action, $exkey1, $exval1, $exkey2, $exval2 ) = split( "[ \t][ \t]*", $intentstring );
@ -689,7 +698,7 @@ sub AMADDevice_Set($$@) {
my $btdev = AttrVal( $name, "setBluetoothDevice", "none" ); my $btdev = AttrVal( $name, "setBluetoothDevice", "none" );
my $list = "screenMsg ttsMsg mediaGoogleMusic:play/pause,stop,next,back mediaSamsungMusic:play/pause,stop,next,back mediaAmazonMusic:play/pause,stop,next,back mediaSpotifyMusic:play/pause,stop,next,back mediaTuneinRadio:play/pause,stop,next,back mediaAldiMusic:play/pause,stop,next,back mediaYouTube:play/pause,stop,next,back mediaYouTubeKids:play/pause,stop,next,back mediaVlcPlayer:play/pause,stop,next,back mediaAudible:play/pause,stop,next,back screenBrightness:slider,0,1,255 screen:on,off,lock,unlock openURL nextAlarmTime:time timer:slider,1,1,60 statusRequest:noArg bluetooth:on,off notifySndFile clearNotificationBar:All,Automagic activateVoiceInput:noArg vibrate:noArg sendIntent openCall closeCall:noArg currentFlowsetUpdate:noArg installFlowSource doNotDisturb:never,always,alarmClockOnly,onlyImportant userFlowState userFlowRun sendSMS startDaydream:noArg volumeUp:noArg volumeDown:noArg mute:on,off showHomeScreen:noArg"; my $list = "screenMsg ttsMsg mediaGoogleMusic:play/pause,stop,next,back mediaSamsungMusic:play/pause,stop,next,back mediaAmazonMusic:play/pause,stop,next,back mediaSpotifyMusic:play/pause,stop,next,back mediaTuneinRadio:play/pause,stop,next,back mediaAldiMusic:play/pause,stop,next,back mediaYouTube:play/pause,stop,next,back mediaYouTubeKids:play/pause,stop,next,back mediaVlcPlayer:play/pause,stop,next,back mediaAudible:play/pause,stop,next,back screenBrightness:slider,0,1,255 screen:on,off,lock,unlock openURL nextAlarmTime:time timer:slider,1,1,60 statusRequest:noArg bluetooth:on,off notifySndFile clearNotificationBar:All,Automagic activateVoiceInput:noArg vibrate:noArg sendIntent openCall closeCall:noArg currentFlowsetUpdate:noArg installFlowSource doNotDisturb:never,always,alarmClockOnly,onlyImportant userFlowState userFlowRun sendSMS startDaydream:noArg volumeUp:noArg volumeDown:noArg mute:on,off showHomeScreen:noArg takePicture:noArg";
$list .= " screenOrientation:auto,landscape,portrait" if( AttrVal( $name, "setScreenOrientation", "0" ) eq "1" ); $list .= " screenOrientation:auto,landscape,portrait" if( AttrVal( $name, "setScreenOrientation", "0" ) eq "1" );
$list .= " screenFullscreen:on,off" if( AttrVal( $name, "setFullscreen", "0" ) eq "1" ); $list .= " screenFullscreen:on,off" if( AttrVal( $name, "setFullscreen", "0" ) eq "1" );