Compare commits
2 Commits
761c8b639d
...
3e2944594f
Author | SHA1 | Date | |
---|---|---|---|
3e2944594f | |||
0fd9b594b6 |
@ -254,9 +254,29 @@ sub NTFY_Publish_Msg
|
|||||||
|
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
readingsBulkUpdateIfChanged($hash, "nrPublishedMessages", $nrPublishedMessages);
|
readingsBulkUpdateIfChanged($hash, "nrPublishedMessages", $nrPublishedMessages);
|
||||||
readingsBulkUpdateIfChanged($hash, "lastUsedTopic", $msg->{topic});
|
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