mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
01_FHEMWEB.pm: changes CL to the inform connection (Forum #82062)
git-svn-id: https://svn.fhem.de/fhem/trunk@15796 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
39b337a703
commit
21d3846a7e
@ -97,6 +97,7 @@ my $FW_lastWebName = ""; # Name of last FHEMWEB instance, for caching
|
||||
my $FW_lastHashUpdate = 0;
|
||||
my $FW_httpRetCode = "";
|
||||
my %FW_csrfTokenCache;
|
||||
my %FW_id2inform;
|
||||
|
||||
#########################
|
||||
# As we are _not_ multithreaded, it is safe to use global variables.
|
||||
@ -270,6 +271,7 @@ FW_Undef($$)
|
||||
my ($hash, $arg) = @_;
|
||||
my $ret = TcpServer_Close($hash);
|
||||
if($hash->{inform}) {
|
||||
delete $FW_id2inform{$hash->{FW_ID}} if($hash->{FW_ID});
|
||||
%FW_visibleDeviceHash = FW_visibleDevices();
|
||||
delete($logInform{$hash->{NAME}});
|
||||
}
|
||||
@ -571,6 +573,8 @@ FW_initInform($$)
|
||||
$me->{inform}{type} = ($FW_room ? "status" : "raw");
|
||||
$me->{inform}{filter} = ($FW_room ? $FW_room : ".*");
|
||||
}
|
||||
$FW_id2inform{$FW_id} = $me if($FW_id);
|
||||
|
||||
my $filter = $me->{inform}{filter};
|
||||
$filter =~ s/([[\]().+?])/\\$1/g if($filter =~ m/room=/); # Forum #80390
|
||||
$filter = "NAME=.*" if($filter eq "room=all");
|
||||
@ -2473,10 +2477,11 @@ FW_fC($@)
|
||||
{
|
||||
my ($cmd, $unique) = @_;
|
||||
my $ret;
|
||||
my $cl = $FW_id && $FW_id2inform{$FW_id} ? $FW_id2inform{$FW_id} : $FW_chash;
|
||||
if($unique) {
|
||||
$ret = AnalyzeCommand($FW_chash, $cmd);
|
||||
$ret = AnalyzeCommand($cl, $cmd);
|
||||
} else {
|
||||
$ret = AnalyzeCommandChain($FW_chash, $cmd);
|
||||
$ret = AnalyzeCommandChain($cl, $cmd);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user