00_TCM: Read Base-Id of Tcm on start
This commit is contained in:
@@ -81,6 +81,17 @@ TCM_Define($$)
|
||||
$hash->{DeviceName} = $dev;
|
||||
$hash->{MODEL} = $model;
|
||||
my $ret = DevIo_OpenDev($hash, 0, undef);
|
||||
|
||||
if($hash->{STATE} eq "opened") {
|
||||
# Read Base-Id of Enocean-Module
|
||||
my $cnt=0;
|
||||
do { # this does not always work, so we try several times
|
||||
my $answer=TCM_Get($hash, ($name, "baseid") );
|
||||
my @fields=split(/[=,]/, $answer);
|
||||
$hash->{BASEID}=$fields[1];
|
||||
$cnt++;
|
||||
} while ($cnt<3 and $hash->{BASEID} eq "");
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user