mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
57_SSCal: contrib 1.3.1
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@21090 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
3a16af39d9
commit
a8a3b67315
@ -48,6 +48,7 @@ eval "use FHEM::Meta;1" or my $modMetaAbsent = 1;
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
my %SSCal_vNotesIntern = (
|
my %SSCal_vNotesIntern = (
|
||||||
|
"1.3.1" => "01.02.2020 add SSCal_errauthlist hash for login/logout API error codes ",
|
||||||
"1.3.0" => "01.02.2020 new command \"cleanCompleteTasks\" to delete completed tasks, \"deleteEventId\" to delete an event id, ".
|
"1.3.0" => "01.02.2020 new command \"cleanCompleteTasks\" to delete completed tasks, \"deleteEventId\" to delete an event id, ".
|
||||||
"new get command \"apiInfo\" - detect and show API info, avoid empty readings ",
|
"new get command \"apiInfo\" - detect and show API info, avoid empty readings ",
|
||||||
"1.2.0" => "29.01.2020 get tasks from calendar with set command 'calToDoList' ",
|
"1.2.0" => "29.01.2020 get tasks from calendar with set command 'calToDoList' ",
|
||||||
@ -74,6 +75,15 @@ my %SSCal_vNotesExtern = (
|
|||||||
"1.0.0" => "18.12.2019 initial "
|
"1.0.0" => "18.12.2019 initial "
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# Aufbau Errorcode-Hashes
|
||||||
|
my %SSCal_errauthlist = (
|
||||||
|
400 => "No such account or the password is incorrect",
|
||||||
|
401 => "Account disabled",
|
||||||
|
402 => "Permission denied",
|
||||||
|
403 => "2-step verification code required",
|
||||||
|
404 => "Failed to authenticate 2-step verification code",
|
||||||
|
);
|
||||||
|
|
||||||
my %SSCal_errlist = (
|
my %SSCal_errlist = (
|
||||||
100 => "Unknown error",
|
100 => "Unknown error",
|
||||||
101 => "No parameter of API, method or version",
|
101 => "No parameter of API, method or version",
|
||||||
@ -2376,7 +2386,7 @@ sub SSCal_login_return ($) {
|
|||||||
my $errorcode = $data->{error}{code};
|
my $errorcode = $data->{error}{code};
|
||||||
|
|
||||||
# Fehlertext zum Errorcode ermitteln
|
# Fehlertext zum Errorcode ermitteln
|
||||||
my $error = SSCal_experror($hash,$errorcode);
|
my $error = SSCal_experrorauth($hash,$errorcode);
|
||||||
|
|
||||||
readingsBeginUpdate ($hash);
|
readingsBeginUpdate ($hash);
|
||||||
readingsBulkUpdate ($hash,"Errorcode", $errorcode);
|
readingsBulkUpdate ($hash,"Errorcode", $errorcode);
|
||||||
@ -2472,7 +2482,7 @@ sub SSCal_logout_return ($) {
|
|||||||
$errorcode = $data->{error}->{code};
|
$errorcode = $data->{error}->{code};
|
||||||
|
|
||||||
# Fehlertext zum Errorcode ermitteln
|
# Fehlertext zum Errorcode ermitteln
|
||||||
$error = SSCal_experror($hash,$errorcode); # Fehlertext zum Errorcode ermitteln
|
$error = SSCal_experrorauth($hash,$errorcode);
|
||||||
|
|
||||||
Log3($name, 2, "$name - ERROR - Logout of User $username was not successful, however SID: \"$sid\" has been deleted. Errorcode: $errorcode - $error");
|
Log3($name, 2, "$name - ERROR - Logout of User $username was not successful, however SID: \"$sid\" has been deleted. Errorcode: $errorcode - $error");
|
||||||
}
|
}
|
||||||
@ -2529,7 +2539,26 @@ return $bool;
|
|||||||
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Auflösung Errorcodes SVS API
|
# Auflösung Errorcodes Calendar AUTH API
|
||||||
|
# Übernahmewerte sind $hash, $errorcode
|
||||||
|
##############################################################################
|
||||||
|
sub SSCal_experrorauth ($$) {
|
||||||
|
my ($hash,$errorcode) = @_;
|
||||||
|
my $device = $hash->{NAME};
|
||||||
|
my $error;
|
||||||
|
|
||||||
|
unless (exists($SSCal_errauthlist{"$errorcode"})) {
|
||||||
|
$error = "Value of errorcode \"$errorcode\" not found.";
|
||||||
|
return ($error);
|
||||||
|
}
|
||||||
|
|
||||||
|
$error = $SSCal_errauthlist{"$errorcode"};
|
||||||
|
|
||||||
|
return ($error);
|
||||||
|
}
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Auflösung Errorcodes Calendar API
|
||||||
# Übernahmewerte sind $hash, $errorcode
|
# Übernahmewerte sind $hash, $errorcode
|
||||||
##############################################################################
|
##############################################################################
|
||||||
sub SSCal_experror ($$) {
|
sub SSCal_experror ($$) {
|
||||||
@ -2542,7 +2571,6 @@ sub SSCal_experror ($$) {
|
|||||||
return ($error);
|
return ($error);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fehlertext aus Hash-Tabelle %errorlist ermitteln
|
|
||||||
$error = $SSCal_errlist{"$errorcode"};
|
$error = $SSCal_errlist{"$errorcode"};
|
||||||
|
|
||||||
return ($error);
|
return ($error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user