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:
parent
f298608b8f
commit
2d47017330
@ -151,11 +151,18 @@ sub HMLAN_RemoveHMPair($) {####################################################
|
|||||||
}
|
}
|
||||||
sub HMLAN_Notify(@) {##########################################################
|
sub HMLAN_Notify(@) {##########################################################
|
||||||
my ($hash,$dev) = @_;
|
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}){
|
||||||
foreach (grep (m/CONNECTED$/,@{$dev->{CHANGED}})) { # connect/disconnect
|
my $aVal = AttrVal($hash->{NAME},"logIDs","");
|
||||||
if ($_ eq "DISCONNECTED") {HMLAN_condUpdate($hash,253);}
|
HMLAN_Attr("set",$hash->{NAME},"logIDs",$aVal) if($aVal);
|
||||||
# elsif ($_ eq "CONNECTED") {covered by init;}
|
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;
|
return;
|
||||||
}
|
}
|
||||||
@ -225,28 +232,34 @@ sub HMLAN_Attr(@) {############################################################
|
|||||||
}
|
}
|
||||||
elsif($aName eq "logIDs"){
|
elsif($aName eq "logIDs"){
|
||||||
if ($cmd eq "set"){
|
if ($cmd eq "set"){
|
||||||
my @ids = split",",$aVal;
|
if ($init_done){
|
||||||
my @idName;
|
my @ids = split",",$aVal;
|
||||||
if (grep /sys/,@ids){
|
my @idName;
|
||||||
push @idName,"sys";
|
if (grep /sys/,@ids){
|
||||||
$defs{$name}{helper}{log}{sys}=1;
|
push @idName,"sys";
|
||||||
|
$defs{$name}{helper}{log}{sys}=1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$defs{$name}{helper}{log}{sys}=0;
|
||||||
|
}
|
||||||
|
if (grep /all/,@ids){
|
||||||
|
push @idName,"all";
|
||||||
|
$defs{$name}{helper}{log}{all}=1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$defs{$name}{helper}{log}{all}=0;
|
||||||
|
$_=substr(CUL_HM_name2Id($_),0,6) foreach(grep !/^$/,@ids);
|
||||||
|
$_="" foreach(grep !/^[A-F0-9]{6}$/,@ids);
|
||||||
|
@ids = HMLAN_noDup(@ids);
|
||||||
|
push @idName,CUL_HM_id2Name($_) foreach(@ids);
|
||||||
|
}
|
||||||
|
$attr{$name}{$aName} = join(",",@idName);
|
||||||
|
@{$defs{$name}{helper}{log}{ids}}=@ids;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$defs{$name}{helper}{log}{sys}=0;
|
$defs{$name}{helper}{attrPend} = 1;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (grep /all/,@ids){
|
|
||||||
push @idName,"all";
|
|
||||||
$defs{$name}{helper}{log}{all}=1;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$defs{$name}{helper}{log}{all}=0;
|
|
||||||
$_=substr(CUL_HM_name2Id($_),0,6) foreach(grep !/^$/,@ids);
|
|
||||||
$_="" foreach(grep !/^[A-F0-9]{6}$/,@ids);
|
|
||||||
@ids = HMLAN_noDup(@ids);
|
|
||||||
push @idName,CUL_HM_id2Name($_) foreach(@ids);
|
|
||||||
}
|
|
||||||
$attr{$name}{$aName} = join(",",@idName);
|
|
||||||
@{$defs{$name}{helper}{log}{ids}}=@ids;
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
my @ids = ();
|
my @ids = ();
|
||||||
|
Loading…
Reference in New Issue
Block a user