2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

Calendar now creates extra events for every changed calendar events (changed: UID mode)

git-svn-id: https://svn.fhem.de/fhem/trunk@1826 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2012-09-01 17:29:04 +00:00
parent 9ad884b8d4
commit 01d0dc97ca
2 changed files with 9 additions and 1 deletions

View File

@ -639,6 +639,7 @@ sub Calendar_CheckTimes($) {
foreach $event (@endedevents) { $event->setMode("end"); }
my @changedevents= grep { $_->modeChanged() } @allevents;
my @upcoming= sort map { $_->uid() } @upcomingevents;
my @alarm= sort map { $_->uid() } @alarmedevents;
@ -649,7 +650,9 @@ sub Calendar_CheckTimes($) {
my @ended= sort map { $_->uid() } grep { $_->modeChanged() } @endedevents;
my @changed= sort map { $_->uid() } @changedevents;
readingsBeginUpdate($hash);
readingsBeginUpdate($hash); # clears all events in CHANGED, thus must be called first
# we create one fhem event for one changed calendar event
map { addEvent($hash, "changed: " . $_->uid() . " " . $_->mode() ); } @changedevents;
readingsUpdate($hash, "lastCheck", $hash->{fhem}{lastCheck});
readingsUpdate($hash, "modeUpcoming", join(";", @upcoming));
readingsUpdate($hash, "modeAlarm", join(";", @alarm));

View File

@ -1507,6 +1507,11 @@ A line ending with \ will be concatenated with the next one, so long lines
</table>
</ul>
<p>
When a calendar event has changed, an event is created in the form
<code>changed: UID mode</code> with mode being the current mode the calendar event is in after the change.
<p>
<b>Usage scenarios</b>
<ul>