2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00
fhem-mirror/fhem/contrib/99_PRIV.pm
rudolfkoenig 71fe020f84 Initial version
git-svn-id: https://svn.fhem.de/fhem/trunk@3 2b470e98-0d58-463d-a4d8-8e2adae1ed80
2007-01-30 12:47:36 +00:00

34 lines
649 B
Perl
Executable File

##############################################
# 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.
package main;
use strict;
use warnings;
sub
PRIV_Initialize($$)
{
my ($hash, $init) = @_;
$hash->{Category} = "none";
}
sub
MyFunc($$)
{
my ($a1, $a2) = @_;
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");
} else {
fhz "roll1 off";
fhz "roll2 off";
}
}
1;