2
0
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:
justme-1968 2015-11-30 12:33:23 +00:00
parent 7aa3fbc0c7
commit 330dcdf292

View File

@ -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 &lt;path&gt;<br>
sends an image</li>
<li>send &lt;text&gt;<br>
sends &lt;text&gt;</li>
<li>image [&lt;number&gt;] &lt;path&gt; [&lt;text&gt;]<br>
sends an image with optional text. &lt;number&gt; has to be given if sending via master device.</li>
<li>send [&lt;numner&gt;] &lt;text&gt;<br>
sends &lt;text&gt;. &lt;number&gt; has to be given if sending via master device.</li>
</ul><br>
<a name="yowsup_Attr"></a>