mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
32_yowsup.pm: added home attribute
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@8774 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b4c64413c6
commit
c1e3eb4857
1
CHANGED
1
CHANGED
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: 32_yowsup.pm: added home attribute
|
||||||
- feature: readingsGroup: allow commands for attributes
|
- feature: readingsGroup: allow commands for attributes
|
||||||
allow calculation with values in the rows and columns
|
allow calculation with values in the rows and columns
|
||||||
allow default mappings with { '' => <default> }
|
allow default mappings with { '' => <default> }
|
||||||
|
@ -24,7 +24,7 @@ yowsup_Initialize($)
|
|||||||
#$hash->{GetFn} = "yowsup_Get";
|
#$hash->{GetFn} = "yowsup_Get";
|
||||||
$hash->{AttrFn} = "yowsup_Attr";
|
$hash->{AttrFn} = "yowsup_Attr";
|
||||||
$hash->{AttrList} = "disable:1 ";
|
$hash->{AttrList} = "disable:1 ";
|
||||||
$hash->{AttrList} .= "acceptFrom cmd ". $readingFnAttributes;
|
$hash->{AttrList} .= "acceptFrom cmd home ". $readingFnAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@ -158,6 +158,12 @@ yowsup_Connect($)
|
|||||||
|
|
||||||
$ENV{PYTHONUNBUFFERED} = 1;
|
$ENV{PYTHONUNBUFFERED} = 1;
|
||||||
|
|
||||||
|
if( my $home = AttrVal($name, "home", undef ) ) {
|
||||||
|
$home = $ENV{'PWD'} if( $home eq 'PWD' );
|
||||||
|
$ENV{'HOME'} = $home;
|
||||||
|
Log3 $name, 2, "$name: setting \$HOME to $home";
|
||||||
|
}
|
||||||
|
|
||||||
my $cmd = AttrVal($name, "cmd", "/opt/local/bin/yowsup-cli demos -c /root/config.yowsup --yowsup" );
|
my $cmd = AttrVal($name, "cmd", "/opt/local/bin/yowsup-cli demos -c /root/config.yowsup --yowsup" );
|
||||||
Log3 $name, 2, "$name: starting yoswup-cli: $cmd";
|
Log3 $name, 2, "$name: starting yoswup-cli: $cmd";
|
||||||
|
|
||||||
@ -528,13 +534,21 @@ yowsup_Attr($$$)
|
|||||||
<li>cmd<br>
|
<li>cmd<br>
|
||||||
complette commandline to start the yowsup cli client<br>
|
complette commandline to start the yowsup cli client<br>
|
||||||
eg: attr WhatsApp cmd /opt/local/bin/yowsup-cli demos -c /root/config.yowsup --yowsup</li>
|
eg: attr WhatsApp cmd /opt/local/bin/yowsup-cli demos -c /root/config.yowsup --yowsup</li>
|
||||||
|
|
||||||
|
<li>home<br>
|
||||||
|
set $HOME for the started yowsup process<br>
|
||||||
|
PWD -> set to $PWD<br>
|
||||||
|
anything else -> use as $HOME</li>
|
||||||
|
|
||||||
<li>accept_from<br>
|
<li>accept_from<br>
|
||||||
comma separated list of contacts (numbers) from which messages will be accepted</li>
|
comma separated list of contacts (numbers) from which messages will be accepted</li>
|
||||||
|
|
||||||
<li>commandPrefix<br>
|
<li>commandPrefix<br>
|
||||||
not set -> don't accept commands<br>
|
not set -> don't accept commands<br>
|
||||||
0 -> don't accept commands<br>
|
0 -> don't accept commands<br>
|
||||||
1 -> allow commands, every message is interpreted as a fhem command<br>
|
1 -> allow commands, every message is interpreted as a fhem command<br>
|
||||||
anything else -> if the message starts with this prefix then everything after the prefix is taken as the command</li>
|
anything else -> if the message starts with this prefix then everything after the prefix is taken as the command</li>
|
||||||
|
|
||||||
<li>allowedCommands<br>
|
<li>allowedCommands<br>
|
||||||
A comma separated list of commands that are allowed from this contact.<br>
|
A comma separated list of commands that are allowed from this contact.<br>
|
||||||
If set to an empty list <code>, (i.e. comma only)</code> no commands are accepted.<br>
|
If set to an empty list <code>, (i.e. comma only)</code> no commands are accepted.<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user