diff --git a/fhem/CHANGED b/fhem/CHANGED
index 04a023234..cbcc5ada3 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -343,3 +343,5 @@
- feature: added archivedir/archivecmd to the the main logfile
- feature: 99_Sunrise_EL.pm (does not need any Date modules)
- bugfix: Seldom xmllist error resulting in corrupt xml (Martin/Peter, 4.9)
+ - bugfix: FHT mode holiday_short added (9.9, Dirk)
+ - bugfix: Modifying a device from its own trigger crashes (Klaus, 10.9)
diff --git a/fhem/FHEM/11_FHT.pm b/fhem/FHEM/11_FHT.pm
index ef45b4a09..672390e49 100755
--- a/fhem/FHEM/11_FHT.pm
+++ b/fhem/FHEM/11_FHT.pm
@@ -103,12 +103,11 @@ my %nosetarg = (
"refreshvalues" => 1,
);
-my %c2m = (0 => "auto", 1 => "manual", 2 => "holiday");
-my %m2c = ("auto" => 0, "manual" => 1, "holiday" => 2);
-
-my %defptr;
+my %c2m = (0 => "auto", 1 => "manual", 2 => "holiday", 3 => "holiday_short");
+my %m2c; # Reverse c2m
my %c2b; # command->button hash (reverse of codes)
my %c2bset; # Setteable values
+my %defptr;
#####################################
@@ -122,6 +121,9 @@ FHT_Initialize($)
$c2b{$v} = $k;
$c2bset{$v} = substr($k, 0, 2) if(!defined($cantset{$v}));
}
+ foreach my $k (keys %c2m) {
+ $m2c{$c2m{$k}} = $k;
+ }
$c2bset{refreshvalues} = "65ff66ff";
# 810c0426 0909a001 1111 1600
diff --git a/fhem/HISTORY b/fhem/HISTORY
index afe6d2710..9b36b4007 100644
--- a/fhem/HISTORY
+++ b/fhem/HISTORY
@@ -138,3 +138,7 @@
- Rudi Mon Sep 3 15:47:59 MEST 2007
- 99_Sunrise_EL.pm checked in. Replaces 99_Sunrise.pm, and does not need
any Date module.
+
+- Rudi Sun Sep 9 08:43:03 MEST 2007
+ - mode holiday_short added + documentation. Not tested.
+ any Date module.
diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html
index 1c99666f6..6f2c48521 100644
--- a/fhem/docs/commandref.html
+++ b/fhem/docs/commandref.html
@@ -1349,6 +1349,9 @@ split in multiple lines
sun-from2
sun-to2
mode
+ holiday1
+ holiday2
+ mode
desired-temp
day-temp
night-temp
@@ -1362,7 +1365,18 @@ split in multiple lines
*-temp
values need a temperature
as argument, which will be rounded to 0.5 Celsiusmode
is one of auto, manual or holiday
mode
is one of auto, manual, holiday or
+ holiday_short.
If the mode is holiday, then
+
+ - holiday1 sets the end-day of the holiday
+ - holiday2 sets the end-month of the holiday
+
+ For holiday_short
+
+ - holiday1 sets the time, in 10-minute steps
+ - holiday2 sets number of days from now on.
+
+
*-from1/*-from2/*-to1/*-to2
valuetypes need a time
spec as argument in the HH:MM format. They define the periods, where
the day-temp is valid. The minute (MM) will be rounded to 10, and
diff --git a/fhem/fhem.pl b/fhem/fhem.pl
index b8fbf7b44..b86470c28 100755
--- a/fhem/fhem.pl
+++ b/fhem/fhem.pl
@@ -134,7 +134,7 @@ my %intAt; # Internal at timer hash.
my $intAtCnt=0;
my $reread_active = 0;
my $AttrList = "room comment";
-my $cvsid = '$Id: fhem.pl,v 1.24 2007-09-08 11:15:40 rudolfkoenig Exp $';
+my $cvsid = '$Id: fhem.pl,v 1.25 2007-09-13 07:13:50 rudolfkoenig Exp $';
$init_done = 0;
@@ -1572,10 +1572,9 @@ DoTrigger($$)
} elsif(!defined($defs{$dev}{CHANGED})) {
return "";
}
- Log 5, "Triggering $dev";
my $max = int(@{$defs{$dev}{CHANGED}});
-
+ Log 5, "Triggering $dev ($max canges)";
return "" if(defined($attr{$dev}) && defined($attr{$dev}{do_not_notify}));
################
@@ -1592,10 +1591,16 @@ DoTrigger($$)
################
# Log/notify modules
- my $ret = "";
- foreach my $n (sort keys %defs) {
- Log 5, "$dev trigger: Checking $n for notify";
- $ret .= CallFn($n, "NotifyFn", $defs{$n}, $defs{$dev});
+ # If modifying a device in its own trigger, do not call the triggers from
+ # the inner loop.
+ if(!defined($defs{$dev}{INTRIGGER})) {
+ $defs{$dev}{INTRIGGER}=1;
+ my $ret = "";
+ foreach my $n (sort keys %defs) {
+ Log 5, "$dev trigger: Checking $n for notify";
+ $ret .= CallFn($n, "NotifyFn", $defs{$n}, $defs{$dev});
+ }
+ delete($defs{$dev}{INTRIGGER});
}
####################
@@ -1604,7 +1609,7 @@ DoTrigger($$)
$oldvalue{$dev}{TIME} = TimeNow();
$oldvalue{$dev}{VAL} = $defs{$dev}{CHANGED}[0];
- delete($defs{$dev}{CHANGED});
+ delete($defs{$dev}{CHANGED}) if(!defined($defs{$dev}{INTRIGGER}));
Log 3, "NTFY return: $ret" if($ret);
return $ret;
diff --git a/fhem/test/fhem.save b/fhem/test/fhem.save
index 6c4db4ea8..f8b993886 100644
--- a/fhem/test/fhem.save
+++ b/fhem/test/fhem.save
@@ -1,12 +1,17 @@
-#Sun Sep 2 16:38:48 2007
+#Thu Sep 13 09:11:22 2007
+setstate EGRollWzRe on
+setstate EGRollWzRe 2007-09-13 09:10:33 state on
+setstate EGRollWzReSteuerung active
+setstate EGTuerWz1 on
+setstate EGTuerWz1 2007-09-13 09:10:33 state on
setstate FHZ fhtbuf: 1c
setstate FHZ 2006-02-12 14:03:39 fhtbuf 23
setstate FHZ 2006-03-26 08:47:36 init2 deadbeefdeadbe
setstate FHZ 2006-03-26 08:47:36 serial deadbeef
setstate btn4 on
setstate btn4 2007-05-17 16:58:46 state on
-setstate cellar on-for-timer 2
-setstate cellar 2007-04-22 14:04:12 state on-for-timer 2
+setstate cellar on
+setstate cellar 2007-09-13 09:10:33 state on
setstate fl measured-temp: 21.6 (Celsius)
setstate fl 2006-03-29 23:02:30 actuator 00%
setstate fl 2006-03-26 08:50:54 day-temp 21.5 (Celsius)
@@ -69,10 +74,10 @@ setstate wz 2006-03-26 08:50:36 wed-from1 06:00
setstate wz 2006-03-26 08:50:36 wed-to1 23:00
setstate wz 2006-03-26 08:52:31 windowopen-temp 12.0 (Celsius)
setstate x 13.66 0.0 30 13.62 15.09 -0.2 2.8
-setstate x 2007-09-02 10:06:47 Is 0.0
-setstate x 2007-09-02 10:06:47 Temp 30
-setstate x 2007-09-02 10:06:47 Vs 13.66
-setstate x 2007-09-02 10:06:47 maxI 2.8
-setstate x 2007-09-02 10:06:47 maxV 15.09
-setstate x 2007-09-02 10:06:47 minI -0.2
-setstate x 2007-09-02 10:06:47 minV 13.62
+setstate x 2007-09-13 09:10:23 Is 0.0
+setstate x 2007-09-13 09:10:23 Temp 30
+setstate x 2007-09-13 09:10:23 Vs 13.66
+setstate x 2007-09-13 09:10:23 maxI 2.8
+setstate x 2007-09-13 09:10:23 maxV 15.09
+setstate x 2007-09-13 09:10:23 minI -0.2
+setstate x 2007-09-13 09:10:23 minV 13.62