57_SSCal: compatibility to DSM7

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@24736 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2021-07-12 15:43:19 +00:00
parent d4545b5a54
commit 94d7f5e116
2 changed files with 18 additions and 10 deletions

View File

@ -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.
# Do not insert empty lines here, update check depends on it.
- change: 57_SSCal: compatibility to DSM7
- bugfix: 10_WS980: v.1.5.0 fix fhem-crash when autodiscovery fails
- change: 10_WS980: allow to ignore invalid values
- feature: 49_SSCam: new value 8.2.8-xxxx for attr simu_SVSversion

View File

@ -3,7 +3,7 @@
#########################################################################################################################
# 57_SSCal.pm
#
# (c) 2019 - 2020 by Heiko Maaz
# (c) 2019 - 2021 by Heiko Maaz
# e-mail: Heiko dot Maaz at t-online dot de
#
# This Module integrate the Synology Calendar into FHEM
@ -140,6 +140,7 @@ BEGIN {
# Versions History intern
my %vNotesIntern = (
"2.4.9" => "11.07.2021 set adaption of AUTH for DSM7 compatibility ",
"2.4.8" => "16.12.2020 accep umlauts in calendar name ",
"2.4.7" => "08.12.2020 fix handle code recognition in createAtDevices as single line ",
"2.4.6" => "06.11.2020 bugfix weekly byDay ",
@ -217,6 +218,11 @@ my %hget = ( # Ha
versionNotes => { fn => \&_getversionNotes, needcred => 0 },
);
my %hvada = ( # Funktionshash Version Adaption
"a01" => {AUTH => "6", INFO => "1", CAL => "2",
EVENT => "3", SHARE => "1", TODO => "1" },
);
# Versions History extern
my %vNotesExtern = (
"2.4.0" => "19.05.2020 Switched to Perl packages. Use <i>FHEM::SSCal::calAsHtml</i> from now instead of ".
@ -873,6 +879,8 @@ sub _setlogout {
my $name = $paref->{name};
logout($hash, $data{SSCal}{$name}{calapi}, $splitstr);
delete $data{SSCal}{$name}{calapi}{PARSET}; # erzwinge Abruf API beim nächsten Login
return;
}
@ -1247,15 +1255,14 @@ sub getApiSites_parse { ## no critic 'complex
# Downgrades für nicht kompatible API-Versionen. Hier nur nutzen wenn API zentral downgraded werden soll
Log3($name, 4, "$name - ------- Begin of adaption section -------");
my @sims;
my $adavs = "a01"; # adaptierte Version
push @sims, "EVENT:3";
for my $esim (@sims) {
my($k,$v) = split ":", $esim;
$data{SSCal}{$name}{calapi}{$k}{VER} = $v;
$data{SSCal}{$name}{calapi}{$k}{MOD} = "yes";
Log3($name, 4, "$name - Version of $data{SSCal}{$name}{calapi}{$k}{NAME} adapted to: $data{SSCal}{$name}{calapi}{$k}{VER}");
if($adavs) {
for my $av (sort keys %{$hvada{$adavs}}) {
$data{SSCal}{$name}{calapi}{$av}{VER} = $hvada{$adavs}{$av};
$data{SSCal}{$name}{calapi}{$av}{MOD} = "yes";
Log3($name, 4, "$name - Version of $data{SSCal}{$name}{calapi}{$av}{NAME} adapted to: $data{SSCal}{$name}{calapi}{$av}{VER}");
}
}
Log3($name, 4, "$name - ------- End of adaption section -------");