mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
49_TBot_List: configure also add with attr confirmUnsolicited
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@14726 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d7676ba64e
commit
df88b36677
1
CHANGED
1
CHANGED
@ -1,5 +1,6 @@
|
||||
# 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.
|
||||
- feature: 49_TBot_List: configure also add with attr confirmUnsolicited
|
||||
- feature: 49_TBot_List: configure confirm delete as attribute confirmDelete
|
||||
- changed: 98_fheminfo.pm: remove release, featurelevel, uptime infos
|
||||
- added: 98_uptime.pm: new command module to show FHEM uptime
|
||||
|
@ -75,7 +75,8 @@
|
||||
# 0.5 2017-05-13 Menu / Sort und fixes
|
||||
#
|
||||
# confirm delete configurable as attribute confirmDelete
|
||||
#
|
||||
# confirm add unsolicited configurable as attribute confirmUnsolicited
|
||||
# 0.6 2017-07-16 confirmDelete & confirmUnsolicited
|
||||
#
|
||||
##############################################################################
|
||||
# TASKS
|
||||
@ -145,6 +146,7 @@ sub TBot_List_Initialize($) {
|
||||
"optionDouble:0,1 ".
|
||||
"handleUnsolicited:0,1 ".
|
||||
"confirmDelete:0,1 ".
|
||||
"confirmUnsolicited:0,1 ".
|
||||
"allowedPeers:textField ".
|
||||
$readingFnAttributes;
|
||||
}
|
||||
@ -407,7 +409,7 @@ sub TBot_List_Attr(@) {
|
||||
if ( ($aName eq 'optionDouble') ) {
|
||||
$aVal = ($aVal eq "1")? "1": "0";
|
||||
|
||||
} elsif ( ($aName eq "confirmDelete" ) ) {
|
||||
} elsif ( ($aName eq "confirmDelete" ) || ($aName eq "confirmUnsolicited" ) ) {
|
||||
$aVal = ($aVal eq "1")? "1": "0";
|
||||
|
||||
} elsif ($aName eq 'allowedPeers') {
|
||||
@ -1103,13 +1105,18 @@ sub TBot_List_handler($$$$;$)
|
||||
|
||||
$arg = TBot_List_changeMultiLine( $arg );
|
||||
|
||||
my $textmsg = "Liste ".$lname."\nSoll der Eintrag ".$arg." hinzugefügt werden?";
|
||||
my $textmsg = "Liste ".$lname."\nSoll der Eintrag ".$arg." hinzugefuegt werden?";
|
||||
if ( defined($msgId ) ) {
|
||||
# store text for adding
|
||||
TBot_List_setMsgId( $hash, $tbot, $chatId, $arg, "expadd" );
|
||||
|
||||
my $inline = "(".TBot_List_inlinekey( $hash, "Ja", "list_expaddyes" )."|".TBot_List_inlinekey( $hash, "Nein", "list_edit" ).")";
|
||||
fhem( "set ".$tbot." queryEditInline $msgId ".'@'.$chatId." $inline $textmsg" );
|
||||
|
||||
if ( AttrVal($name,'confirmUnsolicited',1) ) {
|
||||
my $inline = "(".TBot_List_inlinekey( $hash, "Ja", "list_expaddyes" )."|".TBot_List_inlinekey( $hash, "Nein", "list_edit" ).")";
|
||||
fhem( "set ".$tbot." queryEditInline $msgId ".'@'.$chatId." $inline $textmsg" );
|
||||
} else {
|
||||
# directly add entry --> call recursively
|
||||
TBot_List_handler( $hash, "list_expaddyes", $tbot, $peer );
|
||||
}
|
||||
} else {
|
||||
$ret = "TBot_List_handler: $name - $tbot ERROR no msgId known for peer :$peer: chat :$chatId: cmd :$cmd: ".(defined($arg)?"arg :$arg:":"");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user