mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 20:24:36 +00:00
98_monitoring: blacklist and whitelist are now whitespace seperated instead of space seperated
git-svn-id: https://svn.fhem.de/fhem/trunk@13914 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ce1ed1a02a
commit
1d7ef10c1c
@ -53,7 +53,7 @@ sub monitoring_Initialize($) {
|
|||||||
|
|
||||||
$hash->{AttrList} = ""
|
$hash->{AttrList} = ""
|
||||||
. "addStateEvent:1,0 "
|
. "addStateEvent:1,0 "
|
||||||
. "blacklist "
|
. "blacklist:textField-long "
|
||||||
. "disable:1,0 "
|
. "disable:1,0 "
|
||||||
. "disabledForIntervals "
|
. "disabledForIntervals "
|
||||||
. "errorFuncAdd:textField-long "
|
. "errorFuncAdd:textField-long "
|
||||||
@ -66,7 +66,7 @@ sub monitoring_Initialize($) {
|
|||||||
. "warningFuncRemove:textField-long "
|
. "warningFuncRemove:textField-long "
|
||||||
. "warningWait "
|
. "warningWait "
|
||||||
. "warningReturn:textField-long "
|
. "warningReturn:textField-long "
|
||||||
. "whitelist "
|
. "whitelist:textField-long "
|
||||||
. $readingFnAttributes
|
. $readingFnAttributes
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ sub monitoring_Attr(@) {
|
|||||||
if($attribute =~ "blacklist" && $value){
|
if($attribute =~ "blacklist" && $value){
|
||||||
my @blacklist;
|
my @blacklist;
|
||||||
|
|
||||||
push(@blacklist, devspec2array($_)) foreach (split(" ", $value));
|
push(@blacklist, devspec2array($_)) foreach (split(/[\s]+/, $value));
|
||||||
|
|
||||||
my %blacklist = map{$_, 1} @blacklist;
|
my %blacklist = map{$_, 1} @blacklist;
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ sub monitoring_Attr(@) {
|
|||||||
elsif($attribute eq "whitelist" && $value){
|
elsif($attribute eq "whitelist" && $value){
|
||||||
my @whitelist;
|
my @whitelist;
|
||||||
|
|
||||||
push(@whitelist, devspec2array($_)) foreach (split(" ", $value));
|
push(@whitelist, devspec2array($_)) foreach (split(/[\s]+/, $value));
|
||||||
|
|
||||||
foreach my $list ("warning", "error"){
|
foreach my $list ("warning", "error"){
|
||||||
foreach my $name (split(",", ReadingsVal($SELF, $list, ""))){
|
foreach my $name (split(",", ReadingsVal($SELF, $list, ""))){
|
||||||
@ -263,14 +263,14 @@ sub monitoring_Notify($$) {
|
|||||||
my @blacklist;
|
my @blacklist;
|
||||||
|
|
||||||
push(@blacklist, devspec2array($_))
|
push(@blacklist, devspec2array($_))
|
||||||
foreach (split(" ", AttrVal($SELF, "blacklist", "")));
|
foreach (split(/[\s]+/, AttrVal($SELF, "blacklist", "")));
|
||||||
|
|
||||||
return if(@blacklist && grep(/$name/, @blacklist));
|
return if(@blacklist && grep(/$name/, @blacklist));
|
||||||
|
|
||||||
my @whitelist;
|
my @whitelist;
|
||||||
|
|
||||||
push(@whitelist, devspec2array($_))
|
push(@whitelist, devspec2array($_))
|
||||||
foreach (split(" ", AttrVal($SELF, "whitelist", "")));
|
foreach (split(/[\s]+/, AttrVal($SELF, "whitelist", "")));
|
||||||
|
|
||||||
return if(@whitelist && !(grep(/$name/, @whitelist)));
|
return if(@whitelist && !(grep(/$name/, @whitelist)));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user