Verbesserte Sperrfunktion, neue Attribute für ttsMsg Sprachgeschwindigkeit und Systempath für notifySndFile
This commit is contained in:
		
							
								
								
									
										19
									
								
								74_AMAD.pm
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								74_AMAD.pm
									
									
									
									
									
								
							@@ -37,8 +37,8 @@ use TcpServerUtils;
 | 
				
			|||||||
use Encode qw(encode);
 | 
					use Encode qw(encode);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
my $modulversion = "2.0.2";
 | 
					my $modulversion = "2.0.3";
 | 
				
			||||||
my $flowsetversion = "2.0.4";
 | 
					my $flowsetversion = "2.0.5";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -62,6 +62,8 @@ sub AMAD_Initialize($) {
 | 
				
			|||||||
			  "setScreenlockPIN ".
 | 
								  "setScreenlockPIN ".
 | 
				
			||||||
			  "setScreenOnForTimer ".
 | 
								  "setScreenOnForTimer ".
 | 
				
			||||||
			  "setOpenUrlBrowser ".
 | 
								  "setOpenUrlBrowser ".
 | 
				
			||||||
 | 
								  "setNotifySndFilePath ".
 | 
				
			||||||
 | 
								  "setTtsMsgSpeed ".
 | 
				
			||||||
			  "root:0,1 ".
 | 
								  "root:0,1 ".
 | 
				
			||||||
			  "port ".
 | 
								  "port ".
 | 
				
			||||||
			  "disable:1 ".
 | 
								  "disable:1 ".
 | 
				
			||||||
@@ -159,7 +161,7 @@ sub AMAD_Undef($$) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
sub AMAD_Attr(@) {
 | 
					sub AMAD_Attr(@) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
my ( $cmd, $name, $attrName, $attrVal ) = @_;
 | 
					    my ( $cmd, $name, $attrName, $attrVal ) = @_;
 | 
				
			||||||
    my $hash = $defs{$name};
 | 
					    my $hash = $defs{$name};
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    my $orig = $attrVal;
 | 
					    my $orig = $attrVal;
 | 
				
			||||||
@@ -599,12 +601,13 @@ sub AMAD_SelectSetCmd($$@) {
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    elsif( lc $cmd eq 'ttsmsg' ) {
 | 
					    elsif( lc $cmd eq 'ttsmsg' ) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	my $msg = join( " ", @data );
 | 
					        my $msg = join( " ", @data );
 | 
				
			||||||
 | 
					        my $speed = AttrVal( $name, "setTtsMsgSpeed", "1.0" );
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	$msg =~ s/%/%25/g;
 | 
						$msg =~ s/%/%25/g;
 | 
				
			||||||
	$msg =~ s/\s/%20/g;    
 | 
						$msg =~ s/\s/%20/g;    
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/ttsMsg?message=$msg";
 | 
						my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/ttsMsg?message=".$msg."&msgspeed=".$speed;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
	return AMAD_HTTP_POST( $hash,$url );
 | 
						return AMAD_HTTP_POST( $hash,$url );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -775,8 +778,9 @@ sub AMAD_SelectSetCmd($$@) {
 | 
				
			|||||||
    elsif( lc $cmd eq 'notifysndfile' ) {
 | 
					    elsif( lc $cmd eq 'notifysndfile' ) {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
	my $notify = join( " ", @data );
 | 
						my $notify = join( " ", @data );
 | 
				
			||||||
 | 
						my $filepath = AttrVal( $name, "setNotifySndFilePath", "/storage/emulated/0/Notifications/" );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/playnotifysnd?notifyfile=$notify";
 | 
						my $url = "http://" . $host . ":" . $port . "/fhem-amad/setCommands/playnotifysnd?notifyfile=".$notify."¬ifypath=".$filepath;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
	return AMAD_HTTP_POST( $hash,$url );
 | 
						return AMAD_HTTP_POST( $hash,$url );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -1063,7 +1067,8 @@ sub AMAD_CommBridge_Read($) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if ( $data[0] =~ /currentFlowsetUpdate.xml/ ) {
 | 
					    if ( $data[0] =~ /currentFlowsetUpdate.xml/ ) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $response = qx(cat /opt/fhem/FHEM/lib/74_AMADautomagicFlowset_$flowsetversion.xml);
 | 
					        my $fhempath = $attr{global}{modpath};
 | 
				
			||||||
 | 
					        $response = qx(cat $fhempath/FHEM/lib/74_AMADautomagicFlowset_$flowsetversion.xml);
 | 
				
			||||||
        $c = $hash->{CD};
 | 
					        $c = $hash->{CD};
 | 
				
			||||||
        print $c "HTTP/1.1 200 OK\r\n",
 | 
					        print $c "HTTP/1.1 200 OK\r\n",
 | 
				
			||||||
            "Content-Type: text/plain\r\n",
 | 
					            "Content-Type: text/plain\r\n",
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user