2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 10:46:03 +00:00

eventMap state bugfix (PlusPus & Plus)

git-svn-id: https://svn.fhem.de/fhem/trunk@1578 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2012-05-23 09:01:25 +00:00
parent d282361ab1
commit 203df9f54c

View File

@ -2618,18 +2618,18 @@ ReplaceEventMap($$$)
my $nstr = join(" ", @{$str}) if(!$dir); my $nstr = join(" ", @{$str}) if(!$dir);
my $changed; my $changed;
foreach my $rv (split($sc, $em)) { foreach my $rv (split($sc, $em)) {
my ($re, $val) = split(":", $rv, 2); my ($re, $val) = split(":", $rv, 2); # Real-Event-Regexp:GivenName
next if(!defined($val)); next if(!defined($val));
if($dir) { # event -> Presentation if($dir) { # event -> GivenName
if($str =~ m/$re/) { if($str =~ m/$re/) {
$str =~ s/$re/$val/; $str =~ s/$re/$val/;
$changed = 1; $changed = 1;
last; last;
} }
} else { # Setting event } else { # GivenName -> set command
if($nstr =~ m/$val/) { if($nstr =~ m/\b$val\b/) {
$nstr =~ s/$val/$re/; $nstr =~ s/\b$val\b/$re/;
$changed = 1; $changed = 1;
last; last;
} }