2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

correct startup-sequence to set logIDs in HMLAN

git-svn-id: https://svn.fhem.de/fhem/trunk@4243 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2013-11-18 08:48:43 +00:00
parent f298608b8f
commit 2d47017330

View File

@ -151,12 +151,19 @@ sub HMLAN_RemoveHMPair($) {####################################################
}
sub HMLAN_Notify(@) {##########################################################
my ($hash,$dev) = @_;
return if ($dev->{NAME} ne $hash->{NAME}); # looking for our own connect/disconnect
if ($dev->{NAME} eq "global" && grep (m/^INITIALIZED$/,@{$dev->{CHANGED}})){
if ($hash->{helper}{attrPend}){
my $aVal = AttrVal($hash->{NAME},"logIDs","");
HMLAN_Attr("set",$hash->{NAME},"logIDs",$aVal) if($aVal);
delete $hash->{helper}{attrPend};
}
}
elsif ($dev->{NAME} eq $hash->{NAME}){
foreach (grep (m/CONNECTED$/,@{$dev->{CHANGED}})) { # connect/disconnect
if ($_ eq "DISCONNECTED") {HMLAN_condUpdate($hash,253);}
# elsif ($_ eq "CONNECTED") {covered by init;}
}
}
return;
}
sub HMLAN_Attr(@) {############################################################
@ -225,6 +232,7 @@ sub HMLAN_Attr(@) {############################################################
}
elsif($aName eq "logIDs"){
if ($cmd eq "set"){
if ($init_done){
my @ids = split",",$aVal;
my @idName;
if (grep /sys/,@ids){
@ -248,6 +256,11 @@ sub HMLAN_Attr(@) {############################################################
$attr{$name}{$aName} = join(",",@idName);
@{$defs{$name}{helper}{log}{ids}}=@ids;
}
else{
$defs{$name}{helper}{attrPend} = 1;
return;
}
}
else{
my @ids = ();
$defs{$name}{helper}{log}{sys}=0;