mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
00_MQTT2_SERVER.pm: no LWT if there is another connection with same ip+cid (Forum #90145)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@17205 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
fc3da9b040
commit
b7594bf4b7
@ -102,6 +102,19 @@ MQTT2_SERVER_Undef($@)
|
|||||||
ReadingsVal($sname, "nrclients", 1)-1, 1);
|
ReadingsVal($sname, "nrclients", 1)-1, 1);
|
||||||
|
|
||||||
if($hash->{lwt}) { # Last will
|
if($hash->{lwt}) { # Last will
|
||||||
|
|
||||||
|
# skip lwt if there is another connection with the same ip+cid (tasmota??)
|
||||||
|
for my $dev (keys %defs) {
|
||||||
|
my $h = $defs{$dev};
|
||||||
|
next if($h->{TYPE} ne $hash->{TYPE} ||
|
||||||
|
$h->{NR} == $hash->{NR} ||
|
||||||
|
!$h->{cid} || $h->{cid} ne $hash->{cid} ||
|
||||||
|
!$h->{PEER} || $h->{PEER} ne $hash->{PEER});
|
||||||
|
Log3 $shash, 4,
|
||||||
|
"Closing second connection for $h->{cid}/$h->{PEER} without lwt";
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
my ($tp, $val) = split(':', $hash->{lwt}, 2);
|
my ($tp, $val) = split(':', $hash->{lwt}, 2);
|
||||||
MQTT2_SERVER_doPublish($hash, $shash, $tp, $val, $hash->{cflags} & 0x20);
|
MQTT2_SERVER_doPublish($hash, $shash, $tp, $val, $hash->{cflags} & 0x20);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user