Only send Matrix notification on priority escalation, not title updates

Title changes (e.g. rising Power_On_Hours counter) were firing a Matrix
ping every hour. Notifications now only trigger when priority escalates
to a higher severity level.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 21:43:22 -04:00
parent 499060795e
commit 09292119e6
+12 -8
View File
@@ -265,14 +265,18 @@ if ($existing) {
['reason' => 'auto-updated by hwmonDaemon (condition worsened)'] ['reason' => 'auto-updated by hwmonDaemon (condition worsened)']
)); ));
require_once __DIR__ . '/helpers/NotificationHelper.php'; // Only notify on priority escalation — title-only updates (e.g. rising
NotificationHelper::sendTicketNotification($existingId, [ // Power_On_Hours counter) should not generate a Matrix ping every hour.
'title' => $title, if (isset($changes['priority'])) {
'priority' => $newPriority < $existingPriority ? $newPriority : $existingPriority, require_once __DIR__ . '/helpers/NotificationHelper.php';
'category' => $category, NotificationHelper::sendTicketNotification($existingId, [
'type' => $type, 'title' => $title,
'status' => $existingStatus, 'priority' => $changes['priority']['to'],
], 'automated'); 'category' => $category,
'type' => $type,
'status' => $existingStatus,
], 'automated');
}
} }
$conn->close(); $conn->close();