2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

fhem.pl: add the overrideNotifydev Attribute (Forum #134677)

git-svn-id: https://svn.fhem.de/fhem/trunk@27895 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2023-08-24 12:46:07 +00:00
parent 22b7601dc4
commit 368d6a724a
3 changed files with 23 additions and 2 deletions

View File

@ -418,6 +418,15 @@ Device specific attributes are documented in the corresponding device section.
grouping attribute.
</li><br>
<a name="overrideNotifydev"></a>
<li>overrideNotifydev<br>
if set (the argument is a devspec), the optimization for notifications
is using this value instead of the module-set NOTIFYDEV internal.
Use it only, if you know it better than the module maintainer.
In order to be available, the global or the device userattr must be set
first, to include it.
</li><br>
<a name="room"></a>
<li>room<br>
Filter/group devices in frontends. A device can appear in more than one

View File

@ -416,6 +416,16 @@ Ger&auml;t dokumentiert.
gesetzte Ger&auml;tetyp verwendet.
</li><br>
<a name="overrideNotifydev"></a>
<li>overrideNotifydev<br>
falls gesetzt (das Argument ist ein devspec), dann verwendet die
Optimierung der Benachrichtigungen diesen Wert, statt das vom Modul
gesetzte Internal NOTIFYDEV. Man sollte es nur dann setzen, falls
man es besser weiss, als der Modul Maintainer. Damit es setzbar ist,
muss vorher das global oder Ger&auml;te spezifische userattr
Attribut erg&auml;nzt werden.
</li><br>
<a name="room"></a>
<li>room<br>
Filtert/gruppiert Ger&auml;te.

View File

@ -5630,7 +5630,8 @@ createNtfyHash()
my %d2a_cache;
%ntfyHash = ("*" => []);
foreach my $d (@ntfyList) {
my $ndl = $defs{$d}{NOTIFYDEV};
my $ndl = $attr{$d}{overrideNotifydev};
$ndl = $defs{$d}{NOTIFYDEV} if(!$ndl);
next if(!$ndl);
my @ndlarr;
if($d2a_cache{$ndl}) {
@ -5648,7 +5649,8 @@ createNtfyHash()
my @nhk = keys %ntfyHash;
foreach my $d (@ntfyList) {
my $ndl = $defs{$d}{NOTIFYDEV};
my $ndl = $attr{$d}{overrideNotifydev};
$ndl = $defs{$d}{NOTIFYDEV} if(!$ndl);
my $arr = ($ndl ? $d2a_cache{$ndl} : \@nhk);
map { push @{$ntfyHash{$_}}, $d } @{$arr};
}