mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 01:14:19 +00:00
50_SSChatBot: contrib 1.0.1
git-svn-id: https://svn.fhem.de/fhem/trunk@20713 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c23cdb276c
commit
eeb4e71359
@ -54,14 +54,15 @@ our %SSChatBot_vNotesIntern = (
|
|||||||
|
|
||||||
# Versions History extern
|
# Versions History extern
|
||||||
our %SSChatBot_vNotesExtern = (
|
our %SSChatBot_vNotesExtern = (
|
||||||
"1.0.0" => "12.12.2015 initial "
|
"1.0.1" => "11.12.2019 check OPIDX in parse sendItem, change error code list, complete forbidSend with error text ",
|
||||||
|
"1.0.0" => "08.12.2019 initial "
|
||||||
);
|
);
|
||||||
|
|
||||||
my %SSChatBot_errlist = (
|
my %SSChatBot_errlist = (
|
||||||
100 => "Unknown error",
|
100 => "Unknown error",
|
||||||
101 => "Payload is empty",
|
101 => "Payload is empty",
|
||||||
102 => "API does not exist - may be the Synology Chat Server package is stopped",
|
102 => "API does not exist - may be the Synology Chat Server package is stopped",
|
||||||
117 => "file or file location not valid",
|
117 => "illegal file name or path",
|
||||||
120 => "payload has wrong format",
|
120 => "payload has wrong format",
|
||||||
404 => "bot is not legal - may be the bot is not active or the botToken is wrong",
|
404 => "bot is not legal - may be the bot is not active or the botToken is wrong",
|
||||||
407 => "record not valid",
|
407 => "record not valid",
|
||||||
@ -678,7 +679,7 @@ sub SSChatBot_checkretry ($$) {
|
|||||||
my ($name,$retry) = @_;
|
my ($name,$retry) = @_;
|
||||||
my $hash = $defs{$name};
|
my $hash = $defs{$name};
|
||||||
my $idx = $hash->{OPIDX};
|
my $idx = $hash->{OPIDX};
|
||||||
my $forbidSend = 0;
|
my $forbidSend = "";
|
||||||
|
|
||||||
if(!keys %{$data{SSChatBot}{$name}{sendqueue}{entries}}) {
|
if(!keys %{$data{SSChatBot}{$name}{sendqueue}{entries}}) {
|
||||||
Log3($name, 4, "$name - SendQueue is empty. Nothing to do ...");
|
Log3($name, 4, "$name - SendQueue is empty. Nothing to do ...");
|
||||||
@ -699,7 +700,7 @@ sub SSChatBot_checkretry ($$) {
|
|||||||
|
|
||||||
my $errorcode = ReadingsVal($name, "Errorcode", 0);
|
my $errorcode = ReadingsVal($name, "Errorcode", 0);
|
||||||
if($errorcode =~ /100|101|117|120|407|409|800|900/) { # bei diesen Errorcodes den Queueeintrag nicht wiederholen, da dauerhafter Fehler !
|
if($errorcode =~ /100|101|117|120|407|409|800|900/) { # bei diesen Errorcodes den Queueeintrag nicht wiederholen, da dauerhafter Fehler !
|
||||||
$forbidSend = 1;
|
$forbidSend = SSChatBot_experror($hash,$errorcode); # Fehlertext zum Errorcode ermitteln
|
||||||
$data{SSChatBot}{$name}{sendqueue}{entries}{$idx}{forbidSend} = $forbidSend;
|
$data{SSChatBot}{$name}{sendqueue}{entries}{$idx}{forbidSend} = $forbidSend;
|
||||||
|
|
||||||
Log3($name, 2, "$name - ERROR - \"$hash->{OPMODE}\" SendQueue index \"$idx\" not executed. It seems to be a permanent error. Exclude it from new send attempt !");
|
Log3($name, 2, "$name - ERROR - \"$hash->{OPMODE}\" SendQueue index \"$idx\" not executed. It seems to be a permanent error. Exclude it from new send attempt !");
|
||||||
@ -1135,7 +1136,7 @@ sub SSChatBot_chatop_parse ($) {
|
|||||||
asyncOutput($hash->{HELPER}{CL}{1},"$out");
|
asyncOutput($hash->{HELPER}{CL}{1},"$out");
|
||||||
delete($hash->{HELPER}{CL});
|
delete($hash->{HELPER}{CL});
|
||||||
|
|
||||||
} elsif ($opmode eq "sendItem") {
|
} elsif ($opmode eq "sendItem" && $hash->{OPIDX}) {
|
||||||
my $postid = "";
|
my $postid = "";
|
||||||
my $idx = $hash->{OPIDX};
|
my $idx = $hash->{OPIDX};
|
||||||
my $uid = $data{SSChatBot}{$name}{sendqueue}{entries}{$idx}{userid};
|
my $uid = $data{SSChatBot}{$name}{sendqueue}{entries}{$idx}{userid};
|
||||||
@ -1807,8 +1808,8 @@ sub SSChatBot_CGI() {
|
|||||||
1;
|
1;
|
||||||
|
|
||||||
=pod
|
=pod
|
||||||
=item summary module to use a Synology Chat Bot
|
=item summary module to integrate Synology Chat into FHEM
|
||||||
=item summary_DE Modul zur Installation eines Synology Chat Bot
|
=item summary_DE Modul zur Integration von Synology Chat in FHEM
|
||||||
=begin html
|
=begin html
|
||||||
|
|
||||||
<a name="SSChatBot"></a>
|
<a name="SSChatBot"></a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user