Preparing the release, last doc changes

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@47 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2007-04-14 08:22:18 +00:00
parent e0e512e32c
commit 327d3e54d2
7 changed files with 184 additions and 43 deletions

View File

@@ -1,8 +1,13 @@
##############################################
# Example for notifying with perl-code, in a proper file, not inline.
# Add the following line to the configuration file (02_fs20):
# notifyon btn3 {MyFunc("@", "%")}
# and put this file in the <modpath>/FHEM directory.
# Example perl functions. Put this file into the FHEM directory.
#
# # Activate 2 rollades at once with one button, open them to
# # a different degree.
# define ntfy_1 notifyon btn3 {MyFunc("@", "%")}
#
# # Swith the heater off if all FHT actuators are closed,
# # and on if at least one is open
# define at_1 at +*00:05 { fhem "set heater " . (sumactuator()?"on":"off") };
package main;
use strict;
@@ -12,7 +17,19 @@ sub
PRIV_Initialize($$)
{
my ($hash, $init) = @_;
$hash->{Category} = "none";
}
sub
sumactuator()
{
my $sum = 0;
foreach my $d (keys %defs) {
next if($defs{$d}{TYPE} ne "FHT");
my ($act, undef) = split(" ", $defs{$d}{READINGS}{"actuator"}{VAL});
$act =~ s/%//;
$sum += $act;
}
return $sum;
}
sub
@@ -22,11 +39,11 @@ MyFunc($$)
Log 2, "Device $a1 was set to $a2 (type: $defs{$a1}{TYPE})";
if($a2 eq "on") {
fhz "roll1 on-for-timer 10";
fhz "roll2 on-for-timer 16");
fhem "set roll1 on-for-timer 10";
fhem "set roll2 on-for-timer 16";
} else {
fhz "roll1 off";
fhz "roll2 off";
fhem "set roll1 off";
fhem "set roll2 off";
}
}