From d80b7e8c8a28e976a73ef61d2e98746ef6e9d515 Mon Sep 17 00:00:00 2001
From: rudolfkoenig <>
Date: Sat, 16 Dec 2017 18:10:36 +0000
Subject: [PATCH] autocreate: ignoreTypes adds ^$ starting with featurelevel
5.9 (Forum #80775)
git-svn-id: https://svn.fhem.de/fhem/trunk@15620 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/FHEM/98_autocreate.pm | 16 ++++++++++++----
fhem/fhem.pl | 2 +-
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/fhem/FHEM/98_autocreate.pm b/fhem/FHEM/98_autocreate.pm
index 117b872f2..5d74d3f1a 100644
--- a/fhem/FHEM/98_autocreate.pm
+++ b/fhem/FHEM/98_autocreate.pm
@@ -132,6 +132,8 @@ autocreate_Notify($$)
next if(AttrVal($me, "disable", undef));
my $it = AttrVal($me, "ignoreTypes", undef);
+ $it = "^$it\$" if($featurelevel > 5.8); # Forum #80775
+
next if($it && $name =~ m/$it/i);
my $at = AttrVal($me, "autocreateThreshold", undef);
@@ -751,9 +753,12 @@ autocreate_Attr(@)
ignoreTypes
This is a regexp, to ignore certain devices, e.g. the neighbours FHT.
You can specify more than one, with usual regexp syntax, e.g.
- attr autocreate ignoreTypes CUL_HOERMANN.*|FHT_1234|CUL_WS_7
+ attr autocreate ignoreTypes (CUL_HOERMANN.*|FHT_1234|CUL_WS_7)
The word "Types" is somehow misleading, as it actually checks the
- generated device name.
+ generated device name.
+ Note: starting with featurelevel 5.9 the regexp is automatically
+ extended with ^ and $, so that it must match the whole name (same
+ procedure as in notify and FileLog).
@@ -915,9 +920,12 @@ autocreate_Attr(@)
Funk-Heizungsthermostat (FHT) des Nachbarn. In dem Ausdruck können
mehr als ein Gerät über die normale Regexp-Syntax angegeben
werden. Beispiel:
- attr autocreate ignoreTypes CUL_HOERMANN.*|FHT_1234|CUL_WS_7
+ attr autocreate ignoreTypes (CUL_HOERMANN.*|FHT_1234|CUL_WS_7)
Das Wort "Types" ist etwas irreführend, da der Gerätename
- geprüft wird, und nicht der Typ.
+ geprüft wird, und nicht der Typ.
+ Achtung: ab featurelevel 5.9 wird der Regexp automatisch mit
+ ^ und $ ergänzt, muss also den kompletten Namen matchen (genau wie
+ bei notify und FileLog).
diff --git a/fhem/fhem.pl b/fhem/fhem.pl
index 47ef763b8..4cd011d0a 100755
--- a/fhem/fhem.pl
+++ b/fhem/fhem.pl
@@ -2647,7 +2647,7 @@ GlobalAttr($$$$)
}
elsif($name eq "featurelevel") {
- return "$val is not in the form N.N" if($val !~ m/^\d\.\d$/);
+ return "$val is not in the form N.N" if($val !~ m/^\d+\.\d+$/);
$featurelevel = $val;
}