eventMap / multiroom fixes

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@1402 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2012-03-31 11:20:42 +00:00
parent 4d1b79ef75
commit 049c4cebdf
2 changed files with 11 additions and 2 deletions

View File

@ -1841,6 +1841,7 @@ CommandSetstate($$)
if($a[1] =~ m/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) +([^ ].*)$/) { if($a[1] =~ m/^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) +([^ ].*)$/) {
my ($tim, $nameval) = ($1, $2); my ($tim, $nameval) = ($1, $2);
my ($sname, $sval) = split(" ", $nameval, 2); my ($sname, $sval) = split(" ", $nameval, 2);
(undef, $sval) = ReplaceEventMap($d, [$d, $sval], 0) if($attr{$d}{eventMap});
my $ret = CallFn($sdev, "StateFn", $d, $tim, $sname, $sval); my $ret = CallFn($sdev, "StateFn", $d, $tim, $sname, $sval);
if($ret) { if($ret) {
push @rets, $ret; push @rets, $ret;

View File

@ -1939,7 +1939,8 @@ FW_Notify($$)
my $dn = $dev->{NAME}; my $dn = $dev->{NAME};
my $data; my $data;
if($filter eq "all" || AttrVal($dn, "room", "") eq $filter) { my $rn = AttrVal($dn, "room", "");
if($filter eq "all" || $rn =~ m/\b$filter\b/) {
FW_ReadIcons(); FW_ReadIcons();
my @old = ($FW_wname, $FW_ME, $FW_longpoll, $FW_ss, $FW_tp, $FW_subdir); my @old = ($FW_wname, $FW_ME, $FW_longpoll, $FW_ss, $FW_tp, $FW_subdir);
@ -2050,7 +2051,14 @@ FW_devState($$)
if($link) { if($link) {
my $room = AttrVal($d, "room", undef); my $room = AttrVal($d, "room", undef);
$link .= "&room=$room" if($room); if($room) {
if($FW_room && $room =~ m/\b$FW_room\b/) {
$room = $FW_room;
} else {
$room =~ s/,.*//;
}
$link .= "&room=$room";
}
if($FW_longpoll) { if($FW_longpoll) {
$txt = "<a onClick=\"cmd('$FW_ME$FW_subdir?XHR=1&$link')\">$txt</a>"; $txt = "<a onClick=\"cmd('$FW_ME$FW_subdir?XHR=1&$link')\">$txt</a>";