mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
98_monitoring: changed blacklist attribute
git-svn-id: https://svn.fhem.de/fhem/trunk@13814 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
f061cae6bf
commit
341ee705ce
@ -1,5 +1,7 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: 98_monitoring: blacklist attribute is now a space seperated list
|
||||||
|
of devspecs instead a comma seperated list of devices
|
||||||
- bugfix: 32_withings: web token fix
|
- bugfix: 32_withings: web token fix
|
||||||
- bugfix: 93_DbRep: switch wintertime to summertime, minor fixes
|
- bugfix: 93_DbRep: switch wintertime to summertime, minor fixes
|
||||||
- update: 32_withings: account data encryption
|
- update: 32_withings: account data encryption
|
||||||
|
@ -193,7 +193,19 @@ sub monitoring_Attr(@) {
|
|||||||
my ($cmd, $SELF, $attribute, $value) = @_;
|
my ($cmd, $SELF, $attribute, $value) = @_;
|
||||||
my ($hash) = $defs{$SELF};
|
my ($hash) = $defs{$SELF};
|
||||||
|
|
||||||
if($attribute eq "disable"){
|
if($attribute eq "blacklist" && $value){
|
||||||
|
my @blacklist;
|
||||||
|
|
||||||
|
push(@blacklist, devspec2array($_)) foreach (split(" ", $value));
|
||||||
|
|
||||||
|
my %blacklist = map{$_, 1} @blacklist;
|
||||||
|
|
||||||
|
foreach my $name (sort(keys %blacklist)){
|
||||||
|
monitoring_modify("$SELF|warning|remove|$name");
|
||||||
|
monitoring_modify("$SELF|error|remove|$name");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elsif($attribute eq "disable"){
|
||||||
if($cmd eq "set" and $value == 1){
|
if($cmd eq "set" and $value == 1){
|
||||||
monitoring_setActive($hash);
|
monitoring_setActive($hash);
|
||||||
}
|
}
|
||||||
@ -234,7 +246,13 @@ sub monitoring_Notify($$) {
|
|||||||
|| $removeRegex && $removeRegex =~ m/^$name:/
|
|| $removeRegex && $removeRegex =~ m/^$name:/
|
||||||
|| $events
|
|| $events
|
||||||
);
|
);
|
||||||
return if(AttrVal($SELF, "blacklist", "") =~ m/(^|,)$name(,|$)/);
|
|
||||||
|
my @blacklist;
|
||||||
|
|
||||||
|
push(@blacklist, devspec2array($_))
|
||||||
|
foreach (split(" ", AttrVal($SELF, "blacklist", "")));
|
||||||
|
|
||||||
|
return if(@blacklist && grep(/$name/, @blacklist));
|
||||||
|
|
||||||
foreach my $event (@{$events}){
|
foreach my $event (@{$events}){
|
||||||
my $addMatch = "$name:$event" =~ $addRegex;
|
my $addMatch = "$name:$event" =~ $addRegex;
|
||||||
@ -603,7 +621,9 @@ sub monitoring_setActive($) {
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>blacklist</code><br>
|
<code>blacklist</code><br>
|
||||||
Comma-separated list of devices which will be ignored.
|
Space-separated list of devspecs which will be ignored.<br>
|
||||||
|
If the attribute is set all devices which are specified by the devspecs
|
||||||
|
are removed from both lists.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>disable (1|0)</code><br>
|
<code>disable (1|0)</code><br>
|
||||||
@ -1066,7 +1086,9 @@ attr BeamerFilter_monitoring warningFuncRemove {return}</pre>
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>blacklist</code><br>
|
<code>blacklist</code><br>
|
||||||
Durch Komma getrennte Liste von Geräten die ignoriert werden.
|
Durch Leerzeichen getrennte Liste von devspecs die ignoriert werden.<br>
|
||||||
|
Wenn das Attribut gesetzt wird werden alle Geräte die durch die
|
||||||
|
devspecs definiert sind von beiden Listen gelöscht.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<code>disable (1|0)</code><br>
|
<code>disable (1|0)</code><br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user