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

Trigger bugfix

git-svn-id: https://svn.fhem.de/fhem/trunk@90 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2007-09-13 07:13:50 +00:00
parent 9a30543f27
commit c5f04f5c28
6 changed files with 55 additions and 23 deletions

View File

@ -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)

View File

@ -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

View File

@ -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.

View File

@ -1349,6 +1349,9 @@ split in multiple lines<br><br>
sun-from2
sun-to2
mode
holiday1
holiday2
mode
desired-temp
day-temp
night-temp
@ -1362,7 +1365,18 @@ split in multiple lines<br><br>
<ul>
<li>All <code>*-temp</code> values need a temperature
as argument, which will be rounded to 0.5 Celsius</li>
<li><code>mode</code> is one of <code>auto, manual or holiday</code></li>
<li><code>mode</code> is one of <code>auto, manual, holiday or
holiday_short.<br>If the mode is holiday, then
<ul>
<li>holiday1 sets the end-day of the holiday</li>
<li>holiday2 sets the end-month of the holiday</li>
</ul>
For holiday_short
<ul>
<li>holiday1 sets the time, in 10-minute steps</li>
<li>holiday2 sets number of days from now on.</li>
</ul>
</li>
<li>The <code>*-from1/*-from2/*-to1/*-to2</code> 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

View File

@ -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;

View File

@ -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