2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

00_TCM: changes see EnOcean forum

git-svn-id: https://svn.fhem.de/fhem/trunk@23400 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
klaus.schauer 2020-12-21 18:52:49 +00:00
parent b406c2698a
commit d407ed46b8

View File

@ -129,7 +129,7 @@ sub TCM_InitSerialCom($) {
usleep(750 * 1000); usleep(750 * 1000);
# read transceiver IDs # read transceiver IDs
my $baseID = AttrVal($name, "baseID", undef); my $baseID = AttrVal($name, "baseID", undef);
if (defined($baseID)) { if (defined $baseID) {
$hash->{BaseID} = $baseID; $hash->{BaseID} = $baseID;
$hash->{LastID} = sprintf "%08X", (hex $baseID) + 127; $hash->{LastID} = sprintf "%08X", (hex $baseID) + 127;
} elsif ($comType ne "RS485" && $hash->{DeviceName} ne "none") { } elsif ($comType ne "RS485" && $hash->{DeviceName} ne "none") {
@ -144,10 +144,10 @@ sub TCM_InitSerialCom($) {
$hash->{LastID} = '0' x 8; $hash->{LastID} = '0' x 8;
} }
} }
#push(@{$modules{"$hash->{TYPE}"}{BaseID}}, 'F' x 8); if (defined $baseID) {
push(@{$modules{"$hash->{TYPE}"}{BaseID}}, $baseID) if (!grep(/^$baseID$/, @{$modules{"$hash->{TYPE}"}{BaseID}})); 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}};
@{$hash->{helper}{BaseID}} = @{$modules{"$hash->{TYPE}"}{BaseID}}; }
if ($hash->{MODEL} eq "ESP3" && $comType ne "RS485" && $hash->{DeviceName} ne "none") { if ($hash->{MODEL} eq "ESP3" && $comType ne "RS485" && $hash->{DeviceName} ne "none") {
# get chipID # get chipID
my @getChipID = ('get', 'version'); my @getChipID = ('get', 'version');
@ -1479,7 +1479,7 @@ sub TCM_Notify(@) {
} }
} }
if (exists($modules{"$hash->{TYPE}"}{BaseID}) && exists($modules{"$hash->{TYPE}"}{ChipID})) { 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}});
} }
} }
} }