57_CALVIEW.pm 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. # $Id: 57_CALVIEW.pm 13322 2017-02-03 14:20:42Z chris1284 $
  2. ############################
  3. # CALVIEW
  4. # needs a defined Device 57_Calendar
  5. # needs perl-modul Date::Parse
  6. ############################
  7. package main;
  8. use strict;
  9. use warnings;
  10. use POSIX;
  11. use Date::Parse;
  12. sub CALVIEW_Initialize($)
  13. {
  14. my ($hash) = @_;
  15. $hash->{DefFn} = "CALVIEW_Define";
  16. $hash->{UndefFn} = "CALVIEW_Undef";
  17. $hash->{SetFn} = "CALVIEW_Set";
  18. $hash->{NotifyFn} = "CALVIEW_Notify";
  19. $hash->{AttrList} = "datestyle:ISO8601 " .
  20. "disable:0,1 " .
  21. "do_not_notify:1,0 " .
  22. "filterSummary:textField-long " .
  23. "isbirthday:1,0 " .
  24. "maxreadings " .
  25. "modes:next ".
  26. "oldStyledReadings:1,0 " .
  27. "yobfield:_location,_description,_summary " .
  28. $readingFnAttributes;
  29. }
  30. sub CALVIEW_Define($$){
  31. my ( $hash, $def ) = @_;
  32. my @a = split( "[ \t][ \t]*", $def );
  33. return "\"set CALVIEW\" needs at least an argument" if ( @a < 2 );
  34. my $name = $a[0];
  35. my $inter = 43200;
  36. $inter= $a[4] if($#a==4);
  37. my $modes = $a[3];
  38. my @calendars = split( ",", $a[2] );
  39. $hash->{NAME} = $name;
  40. my $calcounter = 1;
  41. foreach my $calender (@calendars)
  42. {
  43. return "invalid Calendername \"$calender\", define it first" if((devspec2array("NAME=$calender")) != 1 );
  44. }
  45. $hash->{KALENDER} = $a[2];
  46. $hash->{STATE} = "Initialized";
  47. $hash->{INTERVAL} = $inter;
  48. $modes = "next" if (!defined($modes));
  49. if ( $modes =~ /^\d+$/) {
  50. if($modes == 1) {$attr{$name}{modes} = "next";}
  51. elsif($modes == 0){$attr{$name}{modes} = "next";}
  52. elsif($modes == 2){$attr{$name}{modes} = "next";}
  53. elsif($modes == 3){$attr{$name}{modes} = "next";}
  54. }
  55. elsif($modes eq "next"){$attr{$name}{modes} = "next";}
  56. else {return "invalid mode \"$modes\", use 0,1,2 or next!"}
  57. InternalTimer(gettimeofday()+2, "CALVIEW_GetUpdate", $hash, 0);
  58. return undef;
  59. }
  60. sub CALVIEW_Undef($$){
  61. my ( $hash, $arg ) = @_;
  62. #DevIo_CloseDev($hash);
  63. RemoveInternalTimer($hash);
  64. return undef;
  65. }
  66. sub CALVIEW_Set($@){
  67. my ( $hash, @a ) = @_;
  68. return "\"set CALVIEW\" needs at least an argument" if ( @a < 2 );
  69. return "\"set CALVIEW\" Unknown argument $a[1], choose one of update" if($a[1] eq '?');
  70. my $name = shift @a;
  71. my $opt = shift @a;
  72. my $arg = join("", @a);
  73. if($opt eq "update"){CALVIEW_GetUpdate($hash);}
  74. }
  75. sub CALVIEW_GetUpdate($){
  76. my ($hash) = @_;
  77. my $name = $hash->{NAME};
  78. #cleanup readings
  79. delete ($hash->{READINGS});
  80. # new timer
  81. RemoveInternalTimer($hash);
  82. InternalTimer(gettimeofday()+$hash->{INTERVAL}, "CALVIEW_GetUpdate", $hash, 1);
  83. readingsBeginUpdate($hash); #start update
  84. my @termine = getsummery($hash);
  85. my $max = AttrVal($name,"maxreadings",0);
  86. if(defined $max && $max =~ /^[+-]?\d+$/){if($max > 190){$max = 190;}}
  87. else{my $max = 190;}
  88. my $counter = 1;
  89. my $samedatecounter = 2;
  90. my $lastterm;
  91. my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
  92. $year += 1900; $mon += 1;
  93. my $date = sprintf('%02d.%02d.%04d', $mday, $mon, $year);
  94. ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time + 86400);
  95. $year += 1900; $mon += 1;
  96. my $datenext = sprintf('%02d.%02d.%04d', $mday, $mon, $year);
  97. my @termineNew;
  98. foreach my $item (@termine ){
  99. my @tempstart=split(/\s+/,$item->[0]);
  100. my @tempend=split(/\s+/,$item->[2]);
  101. my ($D,$M,$Y)=split(/\./,$tempstart[0]);
  102. my ($eD,$eM,$eY)=split(/\./,$tempend[0]);
  103. my @bts=str2time($M."/".$D."/".$Y." ".$tempstart[1]);
  104. #replace the "\," with ","
  105. if(length($item->[1]) > 0){ $item->[1] =~ s/\\,/,/g; }
  106. if( defined($item->[4]) && length($item->[4]) > 0){ $item->[4] =~ s/\\,/,/g; }
  107. if( defined($item->[5]) && length($item->[5]) > 0){ $item->[5] =~ s/\\,/,/g; }
  108. my $isostarttime = $Y."-".$M."-".$D."T".$tempstart[1];
  109. my $isoendtime = $eY."-".$eM."-".$eD."T".$tempend[1];
  110. my $eventDate = fhemTimeLocal(0,0,0,$D,$M-1,$Y-1900);
  111. my $daysleft = floor(($eventDate - time) / 60 / 60 / 24 + 1);
  112. my $daysleft_long;
  113. if( $daysleft == 0){$daysleft_long = "heute";}
  114. elsif( $daysleft == 1){$daysleft_long = "morgen";}
  115. else{$daysleft_long = "in ".$daysleft." Tagen";}
  116. push @termineNew,{
  117. bdate => $tempstart[0],
  118. btime => $tempstart[1],
  119. bdatetimeiso => $isostarttime,
  120. daysleft => $daysleft,
  121. daysleftLong => $daysleft_long,
  122. summary => $item->[1],
  123. source => $item->[3],
  124. location => $item->[4],
  125. description => $item->[5],
  126. edate => $tempend[0],
  127. etime => $tempend[1],
  128. edatetimeiso => $isoendtime,
  129. btimestamp => $bts[0],
  130. mode => $item->[6]};
  131. }
  132. my $todaycounter = 1;
  133. my $tomorrowcounter = 1;
  134. my $readingstyle = AttrVal($name,"oldStyledReadings",0);
  135. my $isbday = AttrVal($name,"isbirthday",0);
  136. my $yobfield = AttrVal($name,"yobfield","_description");
  137. my $filterSummary = AttrVal($name,"filterSummary",".*:.*");
  138. my @arrFilters = split(',' , $filterSummary );
  139. # sort the array by btimestamp
  140. my @sdata = map $_->[0],
  141. sort { $a->[1][0] <=> $b->[1][0] }
  142. map [$_, [$_->{btimestamp}]], @termineNew;
  143. if($readingstyle == 0){
  144. my $age = 0;
  145. my @termyear;
  146. my $validterm = 0;
  147. for my $termin (@sdata){
  148. #if($termin->{summary} =~ /$filterSummary/ ){
  149. foreach my $filter (@arrFilters){
  150. my @arrFilter= split(':' , $filter);
  151. my $sourceFilter = $arrFilter[0];
  152. my $summaryFilter = $arrFilter[1];
  153. if( $termin->{source} =~ /$sourceFilter/ && $termin->{summary} =~ /$summaryFilter/ ){ $validterm =1;}
  154. };
  155. if ($validterm ==1){
  156. #alter berechnen wenn attribut gesetzt ist. alter wird aus "jahr des termins" - "geburtsjahr aus location oder description" errechnet
  157. if($isbday == 1 ){
  158. @termyear = split(/\./,$termin->{bdate});
  159. if($yobfield eq "_location" && defined($termin->{location}) && length($termin->{location}) > 0 && $termin->{location}=~ /^\d+$/ ) { $age = $termyear[2] - ($termin->{location});}
  160. elsif($yobfield eq "_description" && defined($termin->{description})&& length($termin->{description}) > 0 && $termin->{description}=~ /^\d+$/) { $age = $termyear[2] - ($termin->{description});}
  161. elsif($yobfield eq "_summary" && defined($termin->{summary}) && length($termin->{summary}) > 0 ) {my ($byear) = $termin->{summary} =~ /(\d\d\d\d)/ ; $age = $termyear[2] - $byear;}
  162. else {$age = " "}
  163. }
  164. #standard reading t_[3steliger counter] anlegen
  165. if($isbday == 1 ){ readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_age", $age);}
  166. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_bdate", $termin->{bdate});
  167. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_btime", $termin->{btime});
  168. if(AttrVal($name,"datestyle","_description") eq "ISO8601"){readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_bdatetimeiso", $termin->{bdatetimeiso});readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_edatetimeiso", $termin->{edatetimeiso});}
  169. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_daysleft", $termin->{daysleft});
  170. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_daysleftLong", $termin->{daysleftLong});
  171. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_summary", $termin->{summary});
  172. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_source", $termin->{source});
  173. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_location", $termin->{location});
  174. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_description", $termin->{description});
  175. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_edate", $termin->{edate});
  176. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_etime", $termin->{etime});
  177. readingsBulkUpdate($hash, "t_".sprintf ('%03d', $counter)."_mode", $termin->{mode});
  178. #wenn termin heute today readings anlegen
  179. if ($date eq $termin->{bdate} ){
  180. if($isbday == 1 ){ readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_age", $age);}
  181. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_bdate", "heute");
  182. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_btime", $termin->{btime});
  183. if(AttrVal($name,"datestyle","_description") eq "ISO8601"){readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_bdatetimeiso", $termin->{bdatetimeiso});readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_edatetimiso", $termin->{edatetimeiso});}
  184. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $counter)."_daysleft", $termin->{daysleft});
  185. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $counter)."_daysleftLong", $termin->{daysleftLong});
  186. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_summary", $termin->{summary});
  187. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_source", $termin->{source});
  188. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_location", $termin->{location});
  189. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_description", $termin->{description});
  190. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_edate", $termin->{edate});
  191. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_etime", $termin->{etime});
  192. readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter)."_mode", $termin->{mode});
  193. $todaycounter ++;
  194. }
  195. #wenn termin morgen tomorrow readings anlegen
  196. elsif ($datenext eq $termin->{bdate}){
  197. if($isbday == 1 ){readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_age", $age);}
  198. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_bdate", "morgen");
  199. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_btime", $termin->{btime});
  200. if(AttrVal($name,"datestyle","_description") eq "ISO8601"){readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_bdatetimeiso", $termin->{bdatetimeiso});readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_edatetimeiso", $termin->{edatetimeiso});}
  201. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_daysleft", $termin->{daysleft});
  202. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_daysleftLong", $termin->{daysleftLong});
  203. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_summary", $termin->{summary});
  204. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_source", $termin->{source});
  205. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_location", $termin->{location});
  206. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_description", $termin->{description});
  207. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_edate", $termin->{edate});
  208. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_etime", $termin->{etime});
  209. readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter)."_mode", $termin->{mode});
  210. $tomorrowcounter++;
  211. }
  212. last if ($counter++ == $max);
  213. }
  214. $validterm = 0;
  215. };
  216. readingsBulkUpdate($hash, "state", "t: ".($counter-1)." td: ".($todaycounter-1)." tm: ".($tomorrowcounter-1));
  217. readingsBulkUpdate($hash, "c-term", $counter-1);
  218. readingsBulkUpdate($hash, "c-tomorrow", $tomorrowcounter-1);
  219. readingsBulkUpdate($hash, "c-today", $todaycounter-1);
  220. }
  221. else{
  222. my $lastreadingname = "";
  223. my $doppelcounter = 2;
  224. my $inverteddate;
  225. for my $termin (@sdata){ #termin als reading term_[3steliger counter]
  226. my @tempvar = split /\./, $termin->{bdate};
  227. $inverteddate = "$tempvar[2].$tempvar[1].$tempvar[0]";
  228. if($lastreadingname eq $termin->{bdate}."-".$termin->{btime}){ readingsBulkUpdate($hash, $inverteddate."-".$termin->{btime}."-$doppelcounter" , $termin->{summary}); $doppelcounter ++;}
  229. else{readingsBulkUpdate($hash, $inverteddate."-".$termin->{btime} , $termin->{summary}); $doppelcounter = 2;}
  230. $lastreadingname = $termin->{bdate}."-".$termin->{btime};
  231. last if ($counter++ == $max);
  232. };
  233. for my $termin (@sdata){ #check ob temin heute
  234. if ($date eq $termin->{bdate}){readingsBulkUpdate($hash, "today_".sprintf ('%03d', $todaycounter).$termin->{btime}, $termin->{summary});$todaycounter ++;}
  235. #check ob termin morgen
  236. elsif ($datenext eq $termin->{bdate}){readingsBulkUpdate($hash, "tomorrow_".sprintf ('%03d', $tomorrowcounter).$termin->{btime}, $termin->{summary});$tomorrowcounter++;}
  237. };
  238. }
  239. readingsEndUpdate($hash,1); #end update
  240. }
  241. sub getsummery($)
  242. {
  243. my ($hash) = @_;
  244. my @terminliste ;
  245. my $name = $hash->{NAME};
  246. my @calendernamen = split( ",", $hash->{KALENDER});
  247. my $modi = $attr{$name}{modes};
  248. my @modes = split(/,/,$modi);
  249. foreach my $calendername (@calendernamen){
  250. my $all = CallFn($calendername, "GetFn", $defs{$calendername},(" ","uid", "next"));
  251. my @termine=split(/\n/,$all);
  252. foreach my $uid (@termine){
  253. #für jedes event die einzelnen infos holen
  254. my $tmpstarts = CallFn($calendername, "GetFn", $defs{$calendername},(" ","start", $uid));
  255. my @starts = split(/\n/,$tmpstarts);
  256. my $tmpends = CallFn($calendername, "GetFn", $defs{$calendername},(" ","end", $uid));
  257. my @ends = split(/\n/,$tmpends);
  258. my $tmpsummarys = CallFn($calendername, "GetFn", $defs{$calendername},(" ","summary", $uid));
  259. my @summarys = split(/\n/,$tmpsummarys);
  260. my $tmplocations = CallFn($calendername, "GetFn", $defs{$calendername},(" ","location", $uid));
  261. my @locations = split(/\n/,$tmplocations);
  262. my $tmpdescriptions = CallFn($calendername, "GetFn", $defs{$calendername},(" ","description", $uid));
  263. my @description = split(/\n/,$tmpdescriptions);
  264. for(my $i = 1; $i <= (scalar(@starts)); $i++) {
  265. my $internali = $i-1;
  266. my $terminstart = $starts[$internali];
  267. my $termintext = $summarys[$internali];
  268. my $terminend = $ends[$internali];
  269. my $terminort = $locations[$internali];
  270. my $termindescription = $description[$internali];
  271. push(@terminliste, [$terminstart, $termintext, $terminend, $calendername, $terminort, $termindescription, "next"]);
  272. }
  273. };
  274. };
  275. return @terminliste;
  276. }
  277. sub CALVIEW_Notify($$)
  278. {
  279. my ($hash, $extDevHash) = @_;
  280. my $name = $hash->{NAME}; # name calview device
  281. my $extDevName = $extDevHash->{NAME}; # name externes device
  282. my @calendernams = split( ",", $hash->{KALENDER});
  283. my $event;
  284. return "" if(IsDisabled($name)); # wenn attr disabled keine reaktion
  285. foreach my $calendar (@calendernams){
  286. if ($extDevName eq $calendar) {
  287. foreach $event (@{$extDevHash->{CHANGED}}) {
  288. if ($event eq "triggered") {
  289. Log3 $name , 3, "CALVIEW $name - CALENDAR:$extDevName triggered, updating CALVIEW $name ...";
  290. CALVIEW_GetUpdate($hash);
  291. }
  292. }
  293. }
  294. }
  295. }
  296. 1;
  297. =pod
  298. =item device
  299. =item summary provides calendar events in a readable form
  300. =begin html
  301. <a name="CALVIEW"></a>
  302. <h3>CALVIEW</h3>
  303. <ul>This module creates a device with deadlines based on calendar-devices of the 57_Calendar.pm module. You need to install the perl-modul Date::Parse!</ul>
  304. <ul>Actually the module supports only the "get <> next" function of the CALENDAR-Modul.</ul>
  305. <b>Define</b>
  306. <ul><code>define &lt;Name&gt; CALVIEW &lt;calendarname(s) separate with ','&gt; &lt;next&gt; &lt;updateintervall in sec (default 43200)&gt;</code></ul>
  307. <ul><code>define myView CALVIEW Googlecalendar next</code></ul>
  308. <ul><code>define myView CALVIEW Googlecalendar,holiday next 900</code></ul>
  309. <ul>- setting the update interval is not needed normally because every calendar update triggers a caview update</ul>
  310. <a name="CALVIEW set"></a>
  311. <b>Set</b>
  312. <ul><code>set &lt;Name&gt; update</code></ul>
  313. <ul><code>set myView update</code></ul>
  314. <ul>this will manually update all readings from the given CALENDAR Devices</ul>
  315. <b>Attribute</b>
  316. <li>datestyle<br>
  317. not set - the default, disables displaying readings bdatetimeiso / edatetimeiso<br>
  318. ISO8601 - enables readings bdatetimeiso / edatetimeiso (start and end time of term ISO8601 formated like 2017-02-27T00:00:00)
  319. </li><br>
  320. <li>disable<br>
  321. 0 / not set - internal notify function enabled (default) <br>
  322. 1 - disable the internal notify-function of CALVIEW wich is triggered when one of the given CALENDAR devices has updated
  323. </li><br>filterSummary
  324. <li>filterSummary &lt;filtersouce&gt;:&lt;filtersummary&gt;[,&lt;filtersouce&gt;:&lt;filtersummary&gt;]<br>
  325. not set - displays all terms (default .*:.*) <br>
  326. &lt;filtersouce&gt;:&lt;filtersummary&gt;[,&lt;filtersouce&gt;:&lt;filtersummary&gt;] - CALVIEW will display term where summary matches the &lt;filtersouce&gt;:&lt;filtersummary&gt;, several filters must be separated by comma (,)
  327. e.g.: filterSummary Kalender_Abfall:Leichtverpackungen,Kalender_Abfall:Bioabfall
  328. filterSummary Kalender_Abfall:Leichtverpackungen,Kalender_Feiertage:.*,Kalender_Christian:.*,Kalender_Geburtstage:.*
  329. </li><br>
  330. <li>isbirthday<br>
  331. 0 / not set - no age calculation (default) <br>
  332. 1 - age calculation active. The module calculates the age with year given in description or location (see att yobfield).
  333. </li><br>
  334. <li>maxreadings<br>
  335. defines the number of max term as readings
  336. </li><br>
  337. <li>modes<br>
  338. here the CALENDAR modes can be selected , to be displayed in the view
  339. </li><br>
  340. <li>oldStyledReadings<br>
  341. 0 the default style of readings <br>
  342. 1 readings look like "2015.06.21-00:00" with value "Start of Summer"
  343. </li><br>
  344. <li>yobfield<br>
  345. _description - (default) year of birth will be read from term description <br>
  346. _location - year of birth will be read from term location <br>
  347. _summary - year of birth will be read from summary (uses the first sequence of 4 digits in the string)
  348. </li><br>
  349. =end html
  350. =begin html_DE
  351. <a name="CALVIEW"></a>
  352. <h3>CALVIEW</h3>
  353. <ul>Dieses Modul erstellt ein Device welches als Readings Termine eines oder mehrere Kalender(s), basierend auf dem 57_Calendar.pm Modul, besitzt. Ihr müsst das Perl-Modul Date::Parse installieren!</ul>
  354. <ul>Aktuell wird nur die "get <> next" Funktion vom CALENDAR untertstützt.</ul>
  355. <b>Define</b>
  356. <ul><code>define &lt;Name&gt; CALVIEW &lt;Kalendername(n) getrennt durch ','&gt; &lt;next&gt; &lt;updateintervall in sek (default 43200)&gt;</code></ul>
  357. <ul><code>define myView CALVIEW Googlekalender next</code></ul>
  358. <ul><code>define myView CALVIEW Googlekalender,holiday next 900</code></ul>
  359. <ul>- die Einstellung des Aktualisierungsintervalls wird normalerweise nicht benötigt, da jede Kalenderaktualisierung ein Caview-Update auslöst</ul>
  360. <a name="CALVIEW set"></a>
  361. <b>Set</b>
  362. <ul>update readings:</ul>
  363. <ul><code>set &lt;Name&gt; update</code></ul>
  364. <ul><code>set myView update</code></ul><br>
  365. <b>Attributes</b>
  366. <li>datestyle<br>
  367. nicht gesetzt - Standard, Readings bdatetimeiso / edatetimeiso werden nicht gezeigt<br>
  368. ISO8601 - aktiviert die readings bdatetimeiso / edatetimeiso (zeigen Terminstart und Ende im ISO8601 Format zB. 2017-02-27T00:00:00)
  369. </li><br>
  370. <li>disable<br>
  371. 0 / nicht gesetzt - aktiviert die interne Notify-Funktion (Standard) <br>
  372. 1 - deaktiviert die interne Notify-Funktion welche ausgelöst wird wenn sich einer der Kalender aktualisiert hat
  373. </li><br>
  374. <li>filterSummary &lt;filtersouce&gt;:&lt;filtersummary&gt;[,&lt;filtersouce&gt;:&lt;filtersummary&gt;]<br>
  375. not set - zeigt alle Termine (Standard) <br>
  376. &lt;filtersouce&gt;:&lt;filtersummary&gt;[,&lt;filtersouce&gt;:&lt;filtersummary&gt;] - CALVIEW filtert Termine die &lt;filtersquelle&gt;:&lt;filtertitel&gt; entsprechen, mehrere Filter sind durch Komma (,) zu trennen.
  377. zb.: filterSummary Kalender_Abfall:Leichtverpackungen,Kalender_Abfall:Bioabfall
  378. filterSummary Kalender_Abfall:Leichtverpackungen,Kalender_Feiertage:.*,Kalender_Christian:.*,Kalender_Geburtstage:.*
  379. </li><br>
  380. <li>isbirthday<br>
  381. 0 / nicht gesetzt - keine Altersberechnung (Standard) <br>
  382. 1 - aktiviert die Altersberechnung im Modul. Das Alter wird aus der in der Terminbeschreibung (description) angegebenen Jahreszahl (Geburtsjahr) berechnet. (siehe Attribut yobfield)
  383. </li><br>
  384. <li>maxreadings<br>
  385. bestimmt die Anzahl der Termine als Readings
  386. </li><br>
  387. <li>modes<br>
  388. hier können die CALENDAR modi gewählt werden, welche in der View angezeigt werden sollen
  389. </li><br>
  390. <li>oldStyledReadings<br>
  391. 0 die Standarddarstellung für Readings <br>
  392. 1 aktiviert die Termindarstellung im "alten" Format "2015.06.21-00:00" mit Wert "Start of Summer"
  393. </li><br>
  394. <li>yobfield<br>
  395. _description - (der Standard) Geburtsjahr wird aus der Terminbechreibung gelesen <br>
  396. _location - Geburtsjahr wird aus dem Terminort gelesen <br>
  397. _summary - Geburtsjahr wird aus dem Termintiele gelesen (verwendet wird die erste folge von 4 Ziffern im String))
  398. </li><br>
  399. =end html_DE
  400. =cut