From d407ed46b8e78d4f78d4a6f75f9f73a0016ff28d Mon Sep 17 00:00:00 2001 From: "klaus.schauer" <> Date: Mon, 21 Dec 2020 18:52:49 +0000 Subject: [PATCH] 00_TCM: changes see EnOcean forum git-svn-id: https://svn.fhem.de/fhem/trunk@23400 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_TCM.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fhem/FHEM/00_TCM.pm b/fhem/FHEM/00_TCM.pm index fcfc29b58..e10b14d35 100755 --- a/fhem/FHEM/00_TCM.pm +++ b/fhem/FHEM/00_TCM.pm @@ -129,7 +129,7 @@ sub TCM_InitSerialCom($) { usleep(750 * 1000); # read transceiver IDs my $baseID = AttrVal($name, "baseID", undef); - if (defined($baseID)) { + if (defined $baseID) { $hash->{BaseID} = $baseID; $hash->{LastID} = sprintf "%08X", (hex $baseID) + 127; } elsif ($comType ne "RS485" && $hash->{DeviceName} ne "none") { @@ -144,10 +144,10 @@ sub TCM_InitSerialCom($) { $hash->{LastID} = '0' x 8; } } - #push(@{$modules{"$hash->{TYPE}"}{BaseID}}, 'F' x 8); - push(@{$modules{"$hash->{TYPE}"}{BaseID}}, $baseID) if (!grep(/^$baseID$/, @{$modules{"$hash->{TYPE}"}{BaseID}})); - #push(@{$modules{"$hash->{TYPE}"}{BaseID}}, '0' x 8); - @{$hash->{helper}{BaseID}} = @{$modules{"$hash->{TYPE}"}{BaseID}}; + if (defined $baseID) { + push(@{$modules{"$hash->{TYPE}"}{BaseID}}, $baseID) if (!grep(/^$baseID$/, @{$modules{"$hash->{TYPE}"}{BaseID}})); + @{$hash->{helper}{BaseID}} = @{$modules{"$hash->{TYPE}"}{BaseID}}; + } if ($hash->{MODEL} eq "ESP3" && $comType ne "RS485" && $hash->{DeviceName} ne "none") { # get chipID my @getChipID = ('get', 'version'); @@ -1479,7 +1479,7 @@ sub TCM_Notify(@) { } } if (exists($modules{"$hash->{TYPE}"}{BaseID}) && exists($modules{"$hash->{TYPE}"}{ChipID})) { - Log3 $hash->{NAME}, 2, "TCM registered transceiver BaseID: " . join(':', @{$modules{"$hash->{TYPE}"}{BaseID}}) . " ChipID: " . join(':', @{$modules{"$hash->{TYPE}"}{ChipID}}); + Log3 $hash->{NAME}, 2, "TCM registered transceiver BaseID: " . join(':', @{$modules{"$hash->{TYPE}"}{BaseID}}) . " ChipID: " . join(':', @{$modules{"$hash->{TYPE}"}{ChipID}}); } } }