mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 06:48:43 +00:00
01_FHEMWEB.pm: enable more precise JavaScript client notification (Forum #43945)
git-svn-id: https://svn.fhem.de/fhem/trunk@9867 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c439f0e78b
commit
35191cc739
@ -2409,8 +2409,10 @@ FW_Notify($$)
|
||||
|
||||
if($dn eq $ntfy->{SNAME} &&
|
||||
$dev->{CHANGED} &&
|
||||
$dev->{CHANGED}->[0] =~ m/^JS:(.*)$/) {
|
||||
my $data = FW_longpollInfo($h->{fmt}, "#FHEMWEB:$ntfy->{NAME}",$1,"");
|
||||
$dev->{CHANGED}->[0] =~ m/^JS(#([^:]*))?:(.*)$/) {
|
||||
my $data = $3;
|
||||
return if( $2 && $ntfy->{PEER} !~ m/$2/ );
|
||||
$data = FW_longpollInfo($h->{fmt}, "#FHEMWEB:$ntfy->{NAME}",$data,"");
|
||||
addToWritebuffer($ntfy, $data."\n");
|
||||
return;
|
||||
}
|
||||
|
@ -113,6 +113,8 @@ TcpServer_Accept($$)
|
||||
my %nhash;
|
||||
$nhash{NR} = $devcount++;
|
||||
$nhash{NAME} = $cname;
|
||||
$nhash{PEER} = $caddr;
|
||||
$nhash{PORT} = $port;
|
||||
$nhash{FD} = $clientinfo[0]->fileno();
|
||||
$nhash{CD} = $clientinfo[0]; # sysread / close won't work on fileno
|
||||
$nhash{TYPE} = $type;
|
||||
|
Loading…
x
Reference in New Issue
Block a user