check-health: use $FormatLine

This commit is contained in:
Christian Hesse 2023-04-20 23:58:24 +02:00
parent 7ed70bdb26
commit b1cb4cb10f

View file

@ -21,6 +21,7 @@
:global CheckHealthVoltagePercent; :global CheckHealthVoltagePercent;
:global Identity; :global Identity;
:global FormatLine;
:global IfThenElse; :global IfThenElse;
:global LogPrintExit2; :global LogPrintExit2;
:global ScriptLock; :global ScriptLock;
@ -93,8 +94,8 @@ $ScriptLock $0;
subject=([ $SymbolForNotification ("high-voltage-sign,chart-" . [ $IfThenElse ($NumLast < \ subject=([ $SymbolForNotification ("high-voltage-sign,chart-" . [ $IfThenElse ($NumLast < \
$NumCurr) "in" "de" ] . "creasing") ] . "Health warning: " . $Name); \ $NumCurr) "in" "de" ] . "creasing") ] . "Health warning: " . $Name); \
message=("The " . $Name . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \ message=("The " . $Name . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \
"old value: " . ($CheckHealthLast->$Name) . " V\n" . \ [ $FormatLine "old value" ($CheckHealthLast->$Name . " V") ] . "\n" . \
"new value: " . $Value . " V") }); [ $FormatLine "new value" ($Value . " V") ]) });
} else={ } else={
:if ($NumCurr <= $CheckHealthVoltageLow && $NumLast > $CheckHealthVoltageLow) do={ :if ($NumCurr <= $CheckHealthVoltageLow && $NumLast > $CheckHealthVoltageLow) do={
$SendNotification2 ({ origin=$0; \ $SendNotification2 ({ origin=$0; \