From a43e7983acce219af2179ef1fa3512da5cae46f7 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 30 Jan 2018 09:11:09 +0100 Subject: [PATCH] change set command for player, change default ttyMsgSpeed from 5.0 to 5 --- 74_AMADDevice.pm | 54 +++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/74_AMADDevice.pm b/74_AMADDevice.pm index c144b4e..3916071 100644 --- a/74_AMADDevice.pm +++ b/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.1.99.38"; -my $flowsetversion = "4.1.99.6"; +my $modulversion = "4.1.99.40"; +my $flowsetversion = "4.1.99.7"; @@ -421,14 +421,20 @@ sub AMADDevice_WriteReadings($$) { readingsBulkUpdateIfChanged($hash, $t, $v, 1) if( defined( $v ) and ($t ne 'deviceState' or $t ne 'incomingCallerName' or $t ne 'incomingCallerNumber' + or $t ne 'incommingTelegramMessageFrom' + or $t ne 'incommingSmsText' + or $t ne 'incommingWhatsAppMessageFrom' or $t ne 'nfcLastTagID') ); readingsBulkUpdateIfChanged( $hash, $t, ($v / AttrVal($name,'setVolFactor',1)) ) if( $t eq 'volume' and AttrVal($name,'setVolFactor',1) > 1 ); readingsBulkUpdate( $hash, '.'.$t, $v ) if( $t eq 'deviceState' ); - readingsBulkUpdate( $hash, $t, $v ) if( $t eq 'incomingCallerName' + readingsBulkUpdate( $hash, $t, $v ) if( defined( $v ) and ($t eq 'incomingCallerName' or $t eq 'incomingCallerNumber' - or $t eq 'nfcLastTagID' + or $t eq 'incommingTelegramMessageFrom' + or $t eq 'incommingSmsText' + or $t eq 'incommingWhatsAppMessageFrom' + or $t eq 'nfcLastTagID') ); } @@ -465,6 +471,9 @@ sub AMADDevice_Set($$@) { my $path; my $method; + my @playerList = ('GoogleMusic','SamsungMusic','AmazonMusic','SpotifyMusic','TuneinRadio','AldiMusic','YouTube','YouTubeKids','VlcPlayer','Audible','Deezer'); + my @playerCmd = ('mediaPlay','mediaStop','mediaNext','mediaBack'); + my $volMax = AttrVal($name,'setVolMax',15); my $notifyVolMax = AttrVal($name,'setNotifyVolMax',7); my $ringSoundVolMax = AttrVal($name,'setRingSoundVolMax',7); @@ -521,9 +530,9 @@ sub AMADDevice_Set($$@) { } elsif( lc $cmd =~ /^media/ ) { - my $btn = join( " ", @args ); + my $mplayer = join( " ", @args ); - $path = "/fhem-amad/setCommands/multimediaControl?mplayer=".$cmd."&button=".$btn; + $path = "/fhem-amad/setCommands/multimediaControl?button=".$cmd."&mplayer=".$mplayer; $method = "POST"; } @@ -743,7 +752,12 @@ 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 takePicture:noArg"; + my $list = ''; + foreach(@playerCmd) { + $list .= $_ . ':' . join(',',@playerList) . ' '; + } + + $list .= "screenMsg ttsMsg 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" ); @@ -915,7 +929,7 @@ sub AMADDevice_CreateTtsMsgValue($@) { my $ttsmsgvol = AttrVal( $name, "setTtsMsgVol","none"); if( AttrVal($name,"remoteServer","Automagic") ne 'Automagic') { - $speed = AttrVal( $name, "setTtsMsgSpeed", "5.0" ); + $speed = AttrVal( $name, "setTtsMsgSpeed", "5" ); } else { $speed = AttrVal( $name, "setTtsMsgSpeed", "1.0" ); } @@ -1087,14 +1101,10 @@ sub AMADDevice_CreateChangeBtDeviceValue($$) {
  • currentFlowsetUpdate - start flowset update on Android device
  • installFlowSource - install a Automagic flow on device, XML file must be stored in /tmp/ with extension xml. Example: set TabletWohnzimmer installFlowSource WlanUebwerwachen.xml
  • doNotDisturb - sets the do not Disturb Mode, always Disturb, never Disturb, alarmClockOnly alarm Clock only, onlyImportant only important Disturbs
  • -
  • mediaAmazonMusic - play/stop/next/back , controlling the amazon music media player
  • -
  • mediaGoogleMusic - play/stop/next/back , controlling the google play music media player
  • -
  • mediaSpotifyMusic - play/stop/next/back , controlling the spotify media player
  • -
  • mediaTuneinRadio - play/stop/next/back , controlling the TuneinRadio media player
  • -
  • mediaAldiMusic - play/stop/next/back , controlling the Aldi music media player
  • -
  • mediaAudible - play/stop/next/back , controlling the Audible media player
  • -
  • mediaYouTube - play/stop/next/back , controlling the YouTube media player
  • -
  • mediaVlcPlayer - play/stop/next/back , controlling the VLC media player
  • +
  • mediaPlay - play command to media App
  • +
  • mediaStop - stop command to media App
  • +
  • mediaNext - skip Forward command to media App
  • +
  • mediaBack - skip Backward to media App
  • nextAlarmTime - sets the alarm time. Only valid for the next 24 hours.
  • notifySndFile - plays a media-file which by default needs to be stored in the folder "/storage/emulated/0/Notifications/" of the Android device. You may use the attribute setNotifySndFilePath for defining a different folder.
  • openCall - initial a call and hang up after optional time / set DEVICE openCall 0176354 10 call this number and hang up after 10s
  • @@ -1267,14 +1277,10 @@ sub AMADDevice_CreateChangeBtDeviceValue($$) {
  • currentFlowsetUpdate - fürt ein Flowsetupdate auf dem Device durch
  • doNotDisturb - schaltet den nicht stören Modus, always immer stören, never niemals stören, alarmClockOnly nur Wecker darf stören, onlyImportant nur wichtige Störungen
  • installFlowSource - installiert einen Flow auf dem Device, das XML File muss unter /tmp/ liegen und die Endung xml haben. Bsp: set TabletWohnzimmer installFlowSource WlanUebwerwachen.xml
  • -
  • mediaAmazonMusic - play, stop, next, back ,steuert den Amazon Musik Mediaplayer
  • -
  • mediaGoogleMusic - play, stop, next, back ,steuert den Google Play Musik Mediaplayer
  • -
  • mediaSpotifyMusic - play, stop, next, back ,steuert den Spotify Mediaplayer
  • -
  • mediaTuneinRadio - play, stop, next, back ,steuert den TuneIn Radio Mediaplayer
  • -
  • mediaAldiMusic - play, stop, next, back ,steuert den Aldi Musik Mediaplayer
  • -
  • mediaAudible - play, stop, next, back ,steuert den Audible Mediaplayer
  • -
  • mediaYouTube - play, stop, next, back ,steuert den YouTube Mediaplayer
  • -
  • mediaVlcPlayer - play, stop, next, back ,steuert den VLC Mediaplayer
  • +
  • mediaPlay - play Befehl zur Media App
  • +
  • mediaStop - stop Befehl zur Media App
  • +
  • mediaNext - nächster Titel Befehl zur Media App
  • +
  • mediaBack - vorheriger Titel zur Media App
  • nextAlarmTime - setzt die Alarmzeit. gilt aber nur innerhalb der nächsten 24Std.
  • openCall - ruft eine Nummer an und legt optional nach X Sekunden auf / set DEVICE openCall 01736458 10 / ruft die Nummer an und beendet den Anruf nach 10s
  • screenBrightness - setzt die Bildschirmhelligkeit, von 0-255.