mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 00:26:03 +00:00
fix for handling of global:RENAME and global:DELETE events
git-svn-id: https://svn.fhem.de/fhem/trunk@11379 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ad3d01053b
commit
803146e6d1
@ -223,7 +223,7 @@ LightScene_Notify($$)
|
||||
my ($old, $new) = ($1, $2);
|
||||
if( defined($hash->{CONTENT}{$old}) ) {
|
||||
|
||||
$hash->{DEF} =~ s/(\s*)$old(\s*)/$1$new$2/;
|
||||
$hash->{DEF} =~ s/(^|\s+)$old(\s+|$)/$1$new$2/;
|
||||
|
||||
foreach my $scene (keys %{ $hash->{SCENES} }) {
|
||||
$hash->{SCENES}{$scene}{$new} = $hash->{SCENES}{$scene}{$old} if( defined($hash->{SCENES}{$scene}{$old}) );
|
||||
@ -238,7 +238,7 @@ LightScene_Notify($$)
|
||||
|
||||
if( defined($hash->{CONTENT}{$name}) ) {
|
||||
|
||||
$hash->{DEF} =~ s/(\s*)$name(\s*)/ /;
|
||||
$hash->{DEF} =~ s/(^|\s+)$name(\s+|$)/ /;
|
||||
$hash->{DEF} =~ s/^ //;
|
||||
$hash->{DEF} =~ s/ $//;
|
||||
|
||||
|
@ -1126,7 +1126,7 @@ readingsGroup_Notify($$)
|
||||
my ($old, $new) = ($1, $2);
|
||||
if( defined($hash->{CONTENT}{$old}) ) {
|
||||
|
||||
$hash->{DEF} =~ s/(\s*)$old((:\S+)?\s*)/$1$new$2/g;
|
||||
$hash->{DEF} =~ s/(^|\s+)$old((:\S+)?\s*)/$1$new$2/g;
|
||||
}
|
||||
readingsGroup_updateDevices($hash);
|
||||
} elsif( $dev->{NAME} eq "global" && $s =~ m/^DELETED ([^ ]*)$/) {
|
||||
@ -1134,7 +1134,7 @@ readingsGroup_Notify($$)
|
||||
|
||||
if( defined($hash->{CONTENT}{$name}) ) {
|
||||
|
||||
$hash->{DEF} =~ s/(\s*)$name((:\S+)?\s*)/ /g;
|
||||
$hash->{DEF} =~ s/(^|\s+)$name((:\S+)?\s*)/ /g;
|
||||
$hash->{DEF} =~ s/^ //;
|
||||
$hash->{DEF} =~ s/ $//;
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ readingsHistory_Notify($$)
|
||||
my ($old, $new) = ($1, $2);
|
||||
if( defined($hash->{CONTENT}{$old}) ) {
|
||||
|
||||
$hash->{DEF} =~ s/(\s*)$old((:\S+)?\s*)/$1$new$2/g;
|
||||
$hash->{DEF} =~ s/(^|\s+)$old((:\S+)?\s*)/$1$new$2/g;
|
||||
}
|
||||
readingsHistory_updateDevices($hash);
|
||||
} elsif( $dev->{NAME} eq "global" && $s =~ m/^DELETED ([^ ]*)$/) {
|
||||
@ -402,7 +402,7 @@ readingsHistory_Notify($$)
|
||||
|
||||
if( defined($hash->{CONTENT}{$name}) ) {
|
||||
|
||||
$hash->{DEF} =~ s/(\s*)$name((:\S+)?\s*)/ /g;
|
||||
$hash->{DEF} =~ s/(^|\s+)$name((:\S+)?\s*)/ /g;
|
||||
$hash->{DEF} =~ s/^ //;
|
||||
$hash->{DEF} =~ s/ $//;
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ readingsProxy_Notify($$)
|
||||
my ($old, $new) = ($1, $2);
|
||||
if( defined($hash->{CONTENT}{$old}) ) {
|
||||
|
||||
$hash->{DEF} =~ s/(\s*)$old((:\S+)?\s*)/$1$new$2/g;
|
||||
$hash->{DEF} =~ s/(^|\s+)$old((:\S+)?\s*)/$1$new$2/g;
|
||||
}
|
||||
readingsProxy_updateDevices($hash);
|
||||
} elsif( $dev->{NAME} eq "global" && $s =~ m/^DELETED ([^ ]*)$/) {
|
||||
@ -167,7 +167,7 @@ readingsProxy_Notify($$)
|
||||
|
||||
if( defined($hash->{CONTENT}{$name}) ) {
|
||||
|
||||
$hash->{DEF} =~ s/(\s*)$name((:\S+)?\s*)/ /g;
|
||||
$hash->{DEF} =~ s/(^|\s+)$name((:\S+)?\s*)/ /g;
|
||||
$hash->{DEF} =~ s/^ //;
|
||||
$hash->{DEF} =~ s/ $//;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user