mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 13:24:56 +00:00
32_yowsup.pm: allow sending text with images
git-svn-id: https://svn.fhem.de/fhem/trunk@10056 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7aa3fbc0c7
commit
330dcdf292
@ -258,13 +258,20 @@ yowsup_Set($$@)
|
||||
if( $cmd eq 'image' ) {
|
||||
return "MASTER not connected" if( !$phash->{PID} );
|
||||
|
||||
readingsSingleUpdate( $hash, 'sent', 'image: '. join( ' ', @args ), 1 );
|
||||
|
||||
my $number = $hash->{NUMBER};
|
||||
$number =~ s/\./-/;
|
||||
|
||||
my $image = shift(@args);
|
||||
|
||||
return yowsup_Write( $phash, "/image send $hash->{NUMBER} $args[0]" );
|
||||
|
||||
return undef;
|
||||
} elsif( $cmd eq 'send' ) {
|
||||
return "MASTER not connected" if( !$phash->{PID} );
|
||||
|
||||
readingsSingleUpdate( $hash, "sent", join( ' ', @args ), 1 );
|
||||
readingsSingleUpdate( $hash, 'sent', join( ' ', @args ), 1 );
|
||||
|
||||
my $number = $hash->{NUMBER};
|
||||
$number =~ s/\./-/;
|
||||
@ -284,17 +291,19 @@ yowsup_Set($$@)
|
||||
return undef;
|
||||
|
||||
} elsif( $cmd eq 'image' ) {
|
||||
readingsSingleUpdate( $hash, "sent", 'image: '. join( ' ', @args ), 1 );
|
||||
readingsSingleUpdate( $hash, 'sent', 'image: '. join( ' ', @args ), 1 );
|
||||
|
||||
my $number = shift(@args);
|
||||
$number =~ s/\./-/;
|
||||
|
||||
return yowsup_Write( $hash, "/image send $number $args[0]" );
|
||||
my $image = shift(@args);
|
||||
|
||||
return yowsup_Write( $hash, "/image send $number $image '". join( ' ', @args ) ."'" );
|
||||
|
||||
return undef;
|
||||
|
||||
} elsif( $cmd eq 'send' ) {
|
||||
readingsSingleUpdate( $hash, "sent", join( ' ', @args ), 1 );
|
||||
readingsSingleUpdate( $hash, 'sent', join( ' ', @args ), 1 );
|
||||
|
||||
my $number = shift(@args);
|
||||
$number =~ s/\./-/;
|
||||
@ -592,10 +601,10 @@ yowsup_Attr($$$)
|
||||
<a name="yowsup_Set"></a>
|
||||
<b>Set</b>
|
||||
<ul>
|
||||
<li>image <path><br>
|
||||
sends an image</li>
|
||||
<li>send <text><br>
|
||||
sends <text></li>
|
||||
<li>image [<number>] <path> [<text>]<br>
|
||||
sends an image with optional text. <number> has to be given if sending via master device.</li>
|
||||
<li>send [<numner>] <text><br>
|
||||
sends <text>. <number> has to be given if sending via master device.</li>
|
||||
</ul><br>
|
||||
|
||||
<a name="yowsup_Attr"></a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user