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