mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
98_DOIF.pm: DOIF_Readings, event_Readings code optimized
git-svn-id: https://svn.fhem.de/fhem/trunk@28546 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
5eb8a1c6fe
commit
4f9bca39d8
@ -3587,24 +3587,6 @@ DOIF_Notify($$)
|
|||||||
|
|
||||||
delete $hash->{helper}{cur_cmd_nr};
|
delete $hash->{helper}{cur_cmd_nr};
|
||||||
|
|
||||||
if (defined $hash->{Regex}{"DOIF_Readings"}) {
|
|
||||||
foreach $device ("$dev->{NAME}","") {
|
|
||||||
if (defined $hash->{Regex}{"DOIF_Readings"}{$device}) {
|
|
||||||
#readingsBeginUpdate($hash);
|
|
||||||
foreach my $reading (keys %{$hash->{Regex}{"DOIF_Readings"}{$device}}) {
|
|
||||||
my $readingregex=CheckRegexpDoIf($hash,"DOIF_Readings",$dev->{NAME},$reading,$eventa,$eventas);
|
|
||||||
setDOIF_Reading($hash,$reading,$readingregex,"DOIF_Readings",$eventa, $eventas,$dev->{NAME}) if (defined($readingregex));
|
|
||||||
}
|
|
||||||
#readingsEndUpdate($hash, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (defined ($hash->{helper}{DOIF_eventas})) { #$SELF events
|
|
||||||
foreach my $reading (keys %{$hash->{Regex}{"DOIF_Readings"}{$hash->{NAME}}}) {
|
|
||||||
my $readingregex=CheckRegexpDoIf($hash,"DOIF_Readings",$hash->{NAME},$reading,$hash->{helper}{DOIF_eventa},$hash->{helper}{DOIF_eventas});
|
|
||||||
setDOIF_Reading($hash,$reading,$readingregex,"DOIF_Readings",$eventa, $eventas,$dev->{NAME}) if (defined($readingregex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach my $table ("uiTable","uiState") {
|
foreach my $table ("uiTable","uiState") {
|
||||||
if (defined $hash->{Regex}{$table}) {
|
if (defined $hash->{Regex}{$table}) {
|
||||||
@ -3625,27 +3607,26 @@ DOIF_Notify($$)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined $hash->{Regex}{"event_Readings"}) {
|
foreach my $readings ("DOIF_Readings","event_Readings") {
|
||||||
|
if (defined $hash->{Regex}{$readings}) {
|
||||||
foreach $device ("$dev->{NAME}","") {
|
foreach $device ("$dev->{NAME}","") {
|
||||||
if (defined $hash->{Regex}{"event_Readings"}{$device}) {
|
if (defined $hash->{Regex}{$readings}{$device}) {
|
||||||
foreach my $reading (keys %{$hash->{Regex}{"event_Readings"}{$device}}) {
|
foreach my $reading (keys %{$hash->{Regex}{$readings}{$device}}) {
|
||||||
my $readingregex=CheckRegexpDoIf($hash,"event_Readings",$dev->{NAME},$reading,$eventa,$eventas);
|
my $readingregex=CheckRegexpDoIf($hash,$readings,$dev->{NAME},$reading,$eventa,$eventas);
|
||||||
setDOIF_Reading($hash,$reading,$readingregex,"event_Readings",$eventa, $eventas,$dev->{NAME}) if (defined($readingregex));
|
setDOIF_Reading($hash,$reading,$readingregex,$readings,$eventa, $eventas,$dev->{NAME}) if (defined($readingregex));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (defined ($hash->{helper}{DOIF_eventas})) {# $SELF events
|
||||||
|
foreach my $reading (keys %{$hash->{Regex}{$readings}{$hash->{NAME}}}) {
|
||||||
|
my $readingregex=CheckRegexpDoIf($hash,$readings,$hash->{NAME},$reading,$hash->{helper}{DOIF_eventa},$hash->{helper}{DOIF_eventas});
|
||||||
|
setDOIF_Reading($hash,$reading,$readingregex,$readings,$eventa, $eventas,$dev->{NAME}) if (defined($readingregex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# if (defined ($hash->{helper}{DOIF_eventas})) { #$SELF events
|
|
||||||
# foreach my $reading (keys %{$hash->{Regex}{"event_Readings"}{$hash->{NAME}}}) {
|
|
||||||
# my $readingregex=CheckRegexpDoIf($hash,"event_Readings",$hash->{NAME},$reading,$hash->{helper}{DOIF_eventa},$hash->{helper}{DOIF_eventas});
|
|
||||||
# if (defined($readingregex)){
|
|
||||||
# setDOIF_Reading($hash,$reading,$readingregex,"event_Readings",$eventa, $eventas,$dev->{NAME});
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
|
|
||||||
if (defined $hash->{helper}{DOIF_Readings_events}) {
|
if (defined $hash->{helper}{DOIF_Readings_events}) {# only for DOIF_Readings
|
||||||
if ($dev->{NAME} ne $hash->{NAME}) {
|
if ($dev->{NAME} ne $hash->{NAME}) {
|
||||||
@{$hash->{CHANGED}}=@{$hash->{helper}{DOIF_Readings_events}};
|
@{$hash->{CHANGED}}=@{$hash->{helper}{DOIF_Readings_events}};
|
||||||
@{$hash->{CHANGEDWITHSTATE}}=@{$hash->{helper}{DOIF_Readings_eventsState}};
|
@{$hash->{CHANGEDWITHSTATE}}=@{$hash->{helper}{DOIF_Readings_eventsState}};
|
||||||
|
Loading…
Reference in New Issue
Block a user