From efdb3e8955818532701e4ceac401e58f6a734b30 Mon Sep 17 00:00:00 2001 From: CoolTux Date: Mon, 8 Jan 2018 08:15:54 +0000 Subject: [PATCH] 74_AMADDevice: add new set command takePicture,change Commandref git-svn-id: https://svn.fhem.de/fhem/trunk@15825 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/73_AMADCommBridge.pm | 2 +- fhem/FHEM/74_AMADDevice.pm | 31 +- ...xml => 74_AMADautomagicFlowset_4.0.13.xml} | 1398 +++++++++-------- 4 files changed, 804 insertions(+), 628 deletions(-) rename fhem/FHEM/lib/{74_AMADautomagicFlowset_4.0.12.xml => 74_AMADautomagicFlowset_4.0.13.xml} (82%) diff --git a/fhem/CHANGED b/fhem/CHANGED index 2883e0230..9c599223b 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 74_AMADDevice: add new set command "takePicture",change Commandref - feature: 98_GOOGLECAST: support speak command for TTS set castdevice speak "Hallo" - feature: 51_MOBILEALERTS: Added Sensor WL2000 diff --git a/fhem/FHEM/73_AMADCommBridge.pm b/fhem/FHEM/73_AMADCommBridge.pm index c7a073c04..b99c0bdfb 100644 --- a/fhem/FHEM/73_AMADCommBridge.pm +++ b/fhem/FHEM/73_AMADCommBridge.pm @@ -75,7 +75,7 @@ eval "use JSON;1" or $missingModul .= "JSON "; my $modulversion = "4.0.8"; -my $flowsetversion = "4.0.12"; +my $flowsetversion = "4.0.13"; diff --git a/fhem/FHEM/74_AMADDevice.pm b/fhem/FHEM/74_AMADDevice.pm index 3e69c2f2f..a91f8f3e4 100644 --- a/fhem/FHEM/74_AMADDevice.pm +++ b/fhem/FHEM/74_AMADDevice.pm @@ -58,8 +58,8 @@ eval "use Encode qw(encode encode_utf8);1" or $missingModul .= "Encode "; eval "use JSON;1" or $missingModul .= "JSON "; -my $modulversion = "4.0.12"; -my $flowsetversion = "4.0.12"; +my $modulversion = "4.0.13"; +my $flowsetversion = "4.0.13"; @@ -121,6 +121,7 @@ sub AMADDevice_Initialize($) { "root:0,1 ". "disable:1 ". "remoteServer:Automagic,Autoremote,TNES,other ". + "setTakePictureResolution:800x600,1024x768,1280x720,1600x1200,1920x1080 ". "IODev ". $readingFnAttributes; @@ -630,6 +631,14 @@ sub AMADDevice_Set($$@) { $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' ) { my $intentstring = join( " ", @args ); my ( $action, $exkey1, $exval1, $exkey2, $exval2 ) = split( "[ \t][ \t]*", $intentstring ); @@ -689,7 +698,7 @@ sub AMADDevice_Set($$@) { 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 .= " screenFullscreen:on,off" if( AttrVal( $name, "setFullscreen", "0" ) eq "1" ); @@ -1066,11 +1075,18 @@ sub AMADDevice_CreateChangeBtDeviceValue($$) {
  • screenLock - Locks screen with request for PIN. attribute setScreenlockPIN - enter PIN here. Only use numbers, 4-16 numbers required.
  • screenOrientation - Auto,Landscape,Portait, set screen orientation (automatic, horizontal, vertical). attribute setScreenOrientation
  • system - issue system command (only with rooted Android devices). reboot,shutdown,airplanemodeON (can only be switched ON) attribute root, in Automagic "Preferences" "Root functions" need to be enabled.
  • +
  • takePicture - take a camera picture Attribut setTakePictureResolution
  • + +

    + + Attribut + +

    + + Attribute +