mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +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} = ""
|
||||
. "addStateEvent:1,0 "
|
||||
. "blacklist "
|
||||
. "blacklist:textField-long "
|
||||
. "disable:1,0 "
|
||||
. "disabledForIntervals "
|
||||
. "errorFuncAdd:textField-long "
|
||||
@ -66,7 +66,7 @@ sub monitoring_Initialize($) {
|
||||
. "warningFuncRemove:textField-long "
|
||||
. "warningWait "
|
||||
. "warningReturn:textField-long "
|
||||
. "whitelist "
|
||||
. "whitelist:textField-long "
|
||||
. $readingFnAttributes
|
||||
;
|
||||
}
|
||||
@ -197,7 +197,7 @@ sub monitoring_Attr(@) {
|
||||
if($attribute =~ "blacklist" && $value){
|
||||
my @blacklist;
|
||||
|
||||
push(@blacklist, devspec2array($_)) foreach (split(" ", $value));
|
||||
push(@blacklist, devspec2array($_)) foreach (split(/[\s]+/, $value));
|
||||
|
||||
my %blacklist = map{$_, 1} @blacklist;
|
||||
|
||||
@ -209,7 +209,7 @@ sub monitoring_Attr(@) {
|
||||
elsif($attribute eq "whitelist" && $value){
|
||||
my @whitelist;
|
||||
|
||||
push(@whitelist, devspec2array($_)) foreach (split(" ", $value));
|
||||
push(@whitelist, devspec2array($_)) foreach (split(/[\s]+/, $value));
|
||||
|
||||
foreach my $list ("warning", "error"){
|
||||
foreach my $name (split(",", ReadingsVal($SELF, $list, ""))){
|
||||
@ -263,14 +263,14 @@ sub monitoring_Notify($$) {
|
||||
my @blacklist;
|
||||
|
||||
push(@blacklist, devspec2array($_))
|
||||
foreach (split(" ", AttrVal($SELF, "blacklist", "")));
|
||||
foreach (split(/[\s]+/, AttrVal($SELF, "blacklist", "")));
|
||||
|
||||
return if(@blacklist && grep(/$name/, @blacklist));
|
||||
|
||||
my @whitelist;
|
||||
|
||||
push(@whitelist, devspec2array($_))
|
||||
foreach (split(" ", AttrVal($SELF, "whitelist", "")));
|
||||
foreach (split(/[\s]+/, AttrVal($SELF, "whitelist", "")));
|
||||
|
||||
return if(@whitelist && !(grep(/$name/, @whitelist)));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user