diff --git a/fhem/FHEM/57_CALVIEW.pm b/fhem/FHEM/57_CALVIEW.pm index 2f41041fa..763be4dae 100644 --- a/fhem/FHEM/57_CALVIEW.pm +++ b/fhem/FHEM/57_CALVIEW.pm @@ -1,4 +1,4 @@ -# $Id: 57_CALVIEW.pm 7007 2015-01-13 20:15:00Z chris1284 $ +# $Id: 57_CALVIEW.pm 7008 2015-03-05 06:15:00Z chris1284 $ ########################### # CALVIEW # @@ -28,8 +28,8 @@ sub CALVIEW_Define($$){ my @a = split( "[ \t][ \t]*", $def ); return "\"set CALVIEW\" needs at least an argument" if ( @a < 2 ); my $name = $a[0]; - #my $calender = $a[2]; my $inter = 43200; + $inter= $a[4] if($#a==4); my $modes = $a[3]; my @calendars = split( ",", $a[2] ); $hash->{NAME} = $name; @@ -56,19 +56,14 @@ sub CALVIEW_Undef($$){ sub CALVIEW_Set($@){ my ( $hash, @a ) = @_; return "\"set CALVIEW\" needs at least an argument" if ( @a < 2 ); - return "\"set CALVIEW\" Unknown argument $a[1], choose one of update interval" if($a[1] eq '?'); + return "\"set CALVIEW\" Unknown argument $a[1], choose update" if($a[1] eq '?'); my $name = shift @a; my $opt = shift @a; my $arg = join("", @a); if($opt eq "update"){CALVIEW_GetUpdate($hash);} - if($opt eq "interval"){ - if(defined $arg && $arg =~ /^[+-]?\d+$/) - {$hash->{INTERVAL} = $arg;} - } } sub CALVIEW_GetUpdate($){ my ($hash) = @_; - #my $calendername = $hash->{KALENDER}; my $name = $hash->{NAME}; #cleanup readings delete ($hash->{READINGS}); @@ -90,15 +85,6 @@ sub CALVIEW_GetUpdate($){ my $date = "$mday.$mon.$year"; my $datenext = "$nextday.$mon.$year"; my @termineNew; - # foreach my $item (@termine ){ - # my @tempstart=split(/\s+/,$item->[0]); - # my @tempend=split(/\s+/,$item->[2]); - # push @termineNew,{ - # bdate => $tempstart[0], - # btime => $tempstart[1], - # summary => $item->[1], - # edate => $tempend[0], - # etime => $tempend[1]};} foreach my $item (@termine ){ my @tempstart=split(/\s+/,$item->[0]); my @tempend=split(/\s+/,$item->[2]); @@ -113,16 +99,9 @@ sub CALVIEW_GetUpdate($){ edate => $tempend[0], etime => $tempend[1], btimestamp => $bts[0]}; } - #my $termin= \@termineNew; my $todaycounter = 1; my $tomorrowcounter = 1; my $readingstyle = AttrVal($name,"oldStyledReadings",0); - # sort the data in the array by bdate - # my @sdata = map $_->[0], - # sort { $a->[1][2] <=> $b->[1][2] or # year - # $a->[1][1] <=> $b->[1][1] or # month - # $a->[1][0] <=> $b->[1][0] } # day - # map [$_, [split /\./, $_->{bdate}]], @termineNew; # sort the array by btimestamp my @sdata = map $_->[0], sort { $a->[1][0] <=> $b->[1][0] } @@ -217,16 +196,14 @@ sub getsummery($)
define <Name> CALVIEW <calendarname(s) separate with ','> <0 for modeStarted Termine; 1 for modeStarted;modeUpcoming Termine>define <Name> CALVIEW <calendarname(s) separate with ','> <0 for modeStarted Termine; 1 for modeStarted;modeUpcoming Termine> <updateintervall in ms (default 43200)>define myView CALVIEW Googlecalendar 1define myView CALVIEW Googlecalendar,holiday 1 900set <Name> updateset myView updateset <Name> intervall <[time]>set myView intervall 300define <Name> CALVIEW <Kalendername(n) getrennt durch ','> <0 für modeStarted Termine; 1 für modeStarted;modeUpcoming Termine>define <Name> CALVIEW <Kalendername(n) getrennt durch ','> <0 für modeStarted Termine; 1 für modeStarted;modeUpcoming Termine> <updateintervall in ms (default 43200)>define myView CALVIEW Googlekalender 1define myView CALVIEW Googlekalender,holiday 1 900set <Name> updateset myView updateset <Name> intervall <[Zeit]>set myView intervall 300