2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

10_MQTT2_DEVICE.pm: Dix delete WARNINGs for missing CID (Forum #93151)

git-svn-id: https://svn.fhem.de/fhem/trunk@17815 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-11-22 09:20:47 +00:00
parent 6831995451
commit 3cebd1e221

View File

@ -395,9 +395,11 @@ MQTT2_DEVICE_Undef($$)
{
my ($hash, $arg) = @_;
MQTT2_DEVICE_delReading($arg);
my $dpc = $modules{MQTT2_DEVICE}{defptr}{cid}{$hash->{CID}};
my @nh = grep { $_->{NAME} != $hash->{NAME} } @{$dpc};
$modules{MQTT2_DEVICE}{defptr}{cid}{$hash->{CID}} = \@nh;
if($hash->{CID}) {
my $dpc = $modules{MQTT2_DEVICE}{defptr}{cid}{$hash->{CID}};
my @nh = grep { $_->{NAME} ne $hash->{NAME} } @{$dpc};
$modules{MQTT2_DEVICE}{defptr}{cid}{$hash->{CID}} = \@nh;
}
return undef;
}