From 1c3303d8ae7f8725b9c53e1725bedf0fe43d404f Mon Sep 17 00:00:00 2001
From: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
Date: Thu, 25 Feb 2021 19:00:47 +0100
Subject: [PATCH] Notifications : display sensor state textual value (#12554)
* display sensor state textual value
* style
* if then else
---
includes/html/functions.inc.php | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/includes/html/functions.inc.php b/includes/html/functions.inc.php
index 15aa0f8489..10d2fc4dc6 100644
--- a/includes/html/functions.inc.php
+++ b/includes/html/functions.inc.php
@@ -963,7 +963,13 @@ function alert_details($details)
}
if ($tmp_alerts['sensor_id']) {
- $details = 'Current Value: ' . $tmp_alerts['sensor_current'] . ' (' . $tmp_alerts['sensor_class'] . ')
';
+ if ($tmp_alerts['sensor_class'] == 'state') {
+ // Give more details for a state (textual form)
+ $details = 'State: ' . $tmp_alerts['state_descr'] . ' (numerical ' . $tmp_alerts['sensor_current'] . ')
';
+ } else {
+ // Other sensors
+ $details = 'Value: ' . $tmp_alerts['sensor_current'] . ' (' . $tmp_alerts['sensor_class'] . ')
';
+ }
$details_a = [];
if ($tmp_alerts['sensor_limit_low']) {