91_watchdog.pm: add $NAME, $SELF, $TYPE (Forum #123956)

git-svn-id: https://svn.fhem.de/fhem/trunk@25230 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-11-15 09:06:37 +00:00
parent 5b3e55301f
commit 1fdec7e87b

View File

@ -193,9 +193,13 @@ watchdog_Trigger($)
} }
Log3 $name, 3, "Watchdog $name triggered"; Log3 $name, 3, "Watchdog $name triggered";
my $dname = ReadingsVal($name, "triggeredByDev", "");
my %specials= ( my %specials= (
"%DEV" => ReadingsVal($name, "triggeredByDev", ""), "%DEV" => $dname,
"%EVENT" => ReadingsVal($name, "triggeredByEvent", "") "%EVENT" => ReadingsVal($name, "triggeredByEvent", ""),
"%NAME" => $dname,
"%TYPE" => InternalVal($dname, "TYPE", ""),
"%SELF" => $name,
); );
my $exec = EvalSpecials($watchdog->{CMD}, %specials); my $exec = EvalSpecials($watchdog->{CMD}, %specials);
$watchdog->{STATE} = "triggered"; $watchdog->{STATE} = "triggered";
@ -355,8 +359,9 @@ watchdog_Set($@)
currently not possible.</li> currently not possible.</li>
<li>with modify all parameters are optional, and will not be changed if <li>with modify all parameters are optional, and will not be changed if
not specified.</li> not specified.</li>
<li>the device and the event triggering the watchdog is available as $DEV <li>The variables $DEV, $NAME, $EVENT, $EVTPART*, $TYPE and $SELF are
and $EVENT in the executable.</li> available in the executed code, see the notify documentation for
details.</li>
</ul> </ul>
<br> <br>
@ -498,9 +503,9 @@ watchdog_Set($@)
<li>Bei modify sind alle Parameter optional, und werden nicht geaendert, <li>Bei modify sind alle Parameter optional, und werden nicht geaendert,
falls nicht spezifiziert.</li> falls nicht spezifiziert.</li>
<li>Das aktivierende Ger&auml;t und Event sind al $DEV und $EVENT im <li>Die Variablen $DEV, $NAME, $EVENT, $EVTPART*, $TYPE und $SELF stehen
ausf&uuml;hrenden Teil verf&uuml;gbar.</li> im ausgef&uuml;rten Code zur Verf&uuml;gung, sie sind in der notify
Dokumentation genauer beschreiben.</li>
</ul> </ul>
<br> <br>