Fixing device health count mismatch issue
This commit is contained in:
@@ -952,8 +952,9 @@ class TelemetryController extends Controller
|
||||
foreach ($deviceIds as $deviceId) {
|
||||
$device = Device::find($deviceId);
|
||||
if ($device) {
|
||||
$deviceType = $device->type;
|
||||
$telemetryValues = $this->getHealthConditionTelemetry($device);
|
||||
$deviceHealth = $this->telemetryService->getDeviceHealth($telemetryValues);
|
||||
$deviceHealth = $deviceType == 'Torque' ? 'green' : $this->telemetryService->getDeviceHealth($telemetryValues);
|
||||
|
||||
match ($deviceHealth) {
|
||||
'green' => $good++,
|
||||
|
||||
@@ -54,10 +54,10 @@ class TelemetryService
|
||||
}
|
||||
break;
|
||||
|
||||
case 'OT':
|
||||
case 'AT':
|
||||
$val > 50 ? $hasRed = true : $hasOrange = true;
|
||||
break;
|
||||
// case 'OT':
|
||||
// case 'AT':
|
||||
// $val > 50 ? $hasRed = true : $hasOrange = true;
|
||||
// break;
|
||||
|
||||
case 'TDN':
|
||||
if ($val > 0 && $val < 401) {
|
||||
@@ -199,6 +199,7 @@ class TelemetryService
|
||||
'red' => 'Alert',
|
||||
'orange' => 'Attention',
|
||||
'green' => 'Stable',
|
||||
'blue' => 'Stable',
|
||||
default => $t['threshold'] == 70 ? 'Stable' : 'Alert'
|
||||
};
|
||||
}
|
||||
@@ -243,6 +244,7 @@ class TelemetryService
|
||||
'health_status' => !$isActive
|
||||
? 'Offline'
|
||||
: (in_array($displayNameMap[$key], ['Speed', 'RPM']) ? 'Offline' : $status),
|
||||
// 'health_status' => $status,
|
||||
'status_color' => !$isActive ? 'gray' : $statusColor,
|
||||
'thresholds' => $thresholds,
|
||||
'limit' => $thresholdLimits
|
||||
|
||||
Reference in New Issue
Block a user