ADD: provide last used priority as reading
This commit is contained in:
parent
0fd9b594b6
commit
3e2944594f
@ -257,6 +257,26 @@ sub NTFY_Publish_Msg
|
|||||||
readingsBulkUpdateIfChanged($hash, "lastUsedTopic", join(",", @{$msg->{topics}}));
|
readingsBulkUpdateIfChanged($hash, "lastUsedTopic", join(",", @{$msg->{topics}}));
|
||||||
readingsBulkUpdateIfChanged($hash, "lastMessageSend", $msg->{text});
|
readingsBulkUpdateIfChanged($hash, "lastMessageSend", $msg->{text});
|
||||||
readingsBulkUpdateIfChanged($hash, "lastRawMessage", to_json($message));
|
readingsBulkUpdateIfChanged($hash, "lastRawMessage", to_json($message));
|
||||||
|
if ($msg->{priority} == PRIO_MAX)
|
||||||
|
{
|
||||||
|
readingsBulkUpdateIfChanged($hash, "lastUsedPriority", "max");
|
||||||
|
}
|
||||||
|
elsif ($msg->{priority} == PRIO_HIGH)
|
||||||
|
{
|
||||||
|
readingsBulkUpdateIfChanged($hash, "lastUsedPriority", "high");
|
||||||
|
}
|
||||||
|
elsif ($msg->{priority} == PRIO_DEFAULT)
|
||||||
|
{
|
||||||
|
readingsBulkUpdateIfChanged($hash, "lastUsedPriority", "default");
|
||||||
|
}
|
||||||
|
elsif ($msg->{priority} == PRIO_LOW)
|
||||||
|
{
|
||||||
|
readingsBulkUpdateIfChanged($hash, "lastUsedPriority", "low");
|
||||||
|
}
|
||||||
|
elsif ($msg->{priority} == PRIO_MIN)
|
||||||
|
{
|
||||||
|
readingsBulkUpdateIfChanged($hash, "lastUsedPriority", "min");
|
||||||
|
}
|
||||||
readingsBulkUpdateIfChanged($hash, "lastEror", "");
|
readingsBulkUpdateIfChanged($hash, "lastEror", "");
|
||||||
readingsEndUpdate($hash,1);
|
readingsEndUpdate($hash,1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user