From 699c3253b9f19ae3e6c1b0db781b320b8beba9b7 Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Mon, 12 Jul 2021 15:43:19 +0000 Subject: [PATCH] 57_SSCal: compatibility to DSM7 git-svn-id: https://svn.fhem.de/fhem/trunk@24736 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 3 ++- fhem/FHEM/57_SSCal.pm | 25 ++++++++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index e79ca90c2..4c30d40bb 100644 --- a/fhem/CHANGED +++ b/fhem/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. +# 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 diff --git a/fhem/FHEM/57_SSCal.pm b/fhem/FHEM/57_SSCal.pm index 71d2e40d9..d9994d1f2 100644 --- a/fhem/FHEM/57_SSCal.pm +++ b/fhem/FHEM/57_SSCal.pm @@ -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 FHEM::SSCal::calAsHtml 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 -------");