diff --git a/fhem/CHANGED b/fhem/CHANGED index 58e258939..b91a04b34 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. + - feature: 57_Calendar: new field categories (nils_, Forum #79237) - change: 72_FB_CALLMONITOR: delete stored FRITZ!Box password in FHEM/uniqueID file upon deletion of a FB_CALLMONITOR definition - feature: TR064Utils.pm added diff --git a/fhem/FHEM/57_Calendar.pm b/fhem/FHEM/57_Calendar.pm index f42bdbfb9..04bd71cf8 100644 --- a/fhem/FHEM/57_Calendar.pm +++ b/fhem/FHEM/57_Calendar.pm @@ -481,6 +481,11 @@ sub description { return $self->{description}; } +sub categories { + my ($self)= @_; + return $self->{categories}; +} + sub ts($$) { my ($self,$tm)= @_; return "" unless($tm); @@ -505,20 +510,21 @@ sub asText { sub asFull { my ($self)= @_; - return sprintf("%s %9s %s %s-%s %s %s", + return sprintf("%s %9s %s %s-%s %s %s %s", $self->uid(), $self->getMode(), $self->{alarm} ? $self->ts($self->{alarm}) : " ", $self->ts($self->{start}), $self->ts($self->{end}), $self->{summary}, + $self->{categories}, $self->{location} ); } sub asDebug { my ($self)= @_; - return sprintf("%s %s %9s %s %s-%s %s %s %s", + return sprintf("%s %s %9s %s %s-%s %s %s %s %s", $self->uid(), $self->modeChanged() ? "*" : " ", $self->getMode(), @@ -526,6 +532,7 @@ sub asDebug { $self->ts($self->{start}), $self->ts($self->{end}), $self->{summary}, + $self->{categories}, $self->{location}, $self->hasNote() ? $self->getNote() : "" ); @@ -1097,6 +1104,7 @@ sub makeEventDetails($$) { $event->{summary}= $self->valueOrDefault("SUMMARY", ""); $event->{location}= $self->valueOrDefault("LOCATION", ""); $event->{description}= $self->valueOrDefault("DESCRIPTION", ""); + $event->{categories}= $self->valueOrDefault("CATEGORIES", ""); return $event; } @@ -1750,7 +1758,7 @@ sub Calendar_Get($@) { } - my @cmds2= qw/text full summary location description alarm start end uid debug/; + my @cmds2= qw/text full summary location description categories alarm start end uid debug/; if($cmd ~~ @cmds2) { return "argument is missing" if($#a < 2); @@ -1819,6 +1827,7 @@ sub Calendar_Get($@) { push @texts, $event->summary() if $cmd eq "summary"; push @texts, $event->location() if $cmd eq "location"; push @texts, $event->description() if $cmd eq "description"; + push @texts, $event->categories() if $cmd eq "categories"; push @texts, $event->alarmTime() if $cmd eq "alarm"; push @texts, $event->startTime() if $cmd eq "start"; push @texts, $event->endTime() if $cmd eq "end"; @@ -1872,7 +1881,7 @@ sub Calendar_Get($@) { return join(";", keys %uids); } else { - return "Unknown argument $cmd, choose one of update:noArg reload:noArg find text full summary location description alarm start end vcalendar:noArg vevents:noArg"; + return "Unknown argument $cmd, choose one of update:noArg reload:noArg find text full summary location description categories alarm start end vcalendar:noArg vevents:noArg"; } } @@ -2835,9 +2844,11 @@ sub CalendarAsHtml($;$) { texta user-friendly textual representation, best suited for display summarythe content of the summary field (subject, title) locationthe content of the location field + categoriesthe content of the categories field alarmalarm time in human-readable format startstart time in human-readable format endend time in human-readable format + categoriesthe content of the categories field fullthe full state debuglike full with additional information for debugging purposes
@@ -3241,6 +3252,7 @@ sub CalendarAsHtml($;$) { textBenutzer-/Monitorfreundliche Textausgabe. summaryÜbersicht (Betreff, Titel) locationOrt + categoriesKategorien alarmAlarmzeit startStartzeit endEndezeit