2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 20:06:18 +00:00

57_CALVIEW.pm: -update for new CALENDAR modul

git-svn-id: https://svn.fhem.de/fhem/trunk@16821 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
chris1284 2018-06-05 15:01:52 +00:00
parent bc2ca5d980
commit bce3298e0d

View File

@ -334,34 +334,20 @@ sub getsummery($)
my $modi = $attr{$name}{modes}; my $modi = $attr{$name}{modes};
my @modes = split(/,/,$modi); my @modes = split(/,/,$modi);
foreach my $calendername (@calendernamen){ foreach my $calendername (@calendernamen){
my $all = CallFn($calendername, "GetFn", $defs{$calendername},(" ","uid", "next")); my $all = CallFn($calendername, "GetFn", $defs{$calendername},("-","events","format:custom='\$U|\$T1|\$T2|\$S|\$L|\$DS|\$CA'"));
Log3 $name , 5, "CALVIEW $name - All data: \n$all ...";
my @termine=split(/\n/,$all); my @termine=split(/\n/,$all);
foreach my $line (@termine){
foreach my $uid (@termine){ Log3 $name , 5, "CALVIEW $name - Termin: $line";
#für jedes event die einzelnen infos holen my @lineparts = split(/\|/,$line);
my $tmpstarts = CallFn($calendername, "GetFn", $defs{$calendername},(" ","start", $uid)); #my $terminstart = $lineparts[1];
my @starts = split(/\n/,$tmpstarts); #my $terminend = $lineparts[2];
my $tmpends = CallFn($calendername, "GetFn", $defs{$calendername},(" ","end", $uid)); #my $termintext = $lineparts[3];
my @ends = split(/\n/,$tmpends); #my $terminort = $lineparts[4];
my $tmpsummarys = CallFn($calendername, "GetFn", $defs{$calendername},(" ","summary", $uid)); #my $termindescription = $lineparts[5];
my @summarys = split(/\n/,$tmpsummarys); #my $termincategories = $lineparts[6];
my $tmplocations = CallFn($calendername, "GetFn", $defs{$calendername},(" ","location", $uid)); #Log3 $name , 5, "CALVIEW $name - Termin splitted : $terminstart, $termintext, $terminend, $calendername, $terminort, $termindescription, $termincategories";
my @locations = split(/\n/,$tmplocations); push(@terminliste, [$lineparts[1], $lineparts[3], $lineparts[2], $calendername, $lineparts[4], $lineparts[5], $lineparts[6], "next"]);
my $tmpdescriptions = CallFn($calendername, "GetFn", $defs{$calendername},(" ","description", $uid));
my @description = split(/\n/,$tmpdescriptions);
my $tmpcategories = CallFn($calendername, "GetFn", $defs{$calendername},(" ","categories", $uid));
my @categories = split(/\n/,$tmpcategories);
for(my $i = 1; $i <= (scalar(@starts)); $i++) {
my $internali = $i-1;
my $terminstart = $starts[$internali];
my $termintext = $summarys[$internali];
my $terminend = $ends[$internali];
my $terminort = $locations[$internali];
my $termindescription = $description[$internali];
my $termincategories = $categories[$internali];
push(@terminliste, [$terminstart, $termintext, $terminend, $calendername, $terminort, $termindescription, $termincategories, "next"]);
}
}; };
}; };
return @terminliste; return @terminliste;
@ -379,8 +365,9 @@ sub CALVIEW_Notify($$)
if ($extDevName eq $calendar) { if ($extDevName eq $calendar) {
foreach $event (@{$extDevHash->{CHANGED}}) { foreach $event (@{$extDevHash->{CHANGED}}) {
if ($event eq "triggered") { if ($event eq "triggered") {
Log3 $name , 3, "CALVIEW $name - CALENDAR:$extDevName triggered, updating CALVIEW $name ..."; Log3 $name , 5, "CALVIEW $name - CALENDAR:$extDevName triggered, updating CALVIEW $name (CALVIEW_Notify) ...";
CALVIEW_GetUpdate($hash); CALVIEW_GetUpdate($hash);
Log3 $name , 5, "CALVIEW $name - CALENDAR:$extDevName successfully got all updates for CALVIEW $name (CALVIEW_Notify). Now process updates...";
} }
} }
} }