Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b29f4c95a | ||
|
|
45742aa117 | ||
| 4483c7317c | |||
|
|
a0f2431704 | ||
|
|
fc45f740f5 | ||
| 7ade7f620c | |||
| 365d14b11a | |||
| 11883f6757 |
@@ -202,7 +202,7 @@ class AlarmControllerCommon extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return jsonResponseWithErrorMessage('Failed to clear alarm: ' . $clearResponse->body(), $clearResponse->status());
|
||||
} catch (\Exception $e) {
|
||||
Log::error('Error clearing alarm: ' . $e->getMessage());
|
||||
|
||||
@@ -320,8 +320,7 @@ class AlarmService
|
||||
|
||||
if (!empty($data['deviceId'])) {
|
||||
$deviceId = $data['deviceId'];
|
||||
}
|
||||
elseif (!empty($data['assetId'])) {
|
||||
} elseif (!empty($data['assetId'])) {
|
||||
$deviceId = Device::where('asset_id', $data['assetId'])->value('id');
|
||||
}
|
||||
|
||||
@@ -387,7 +386,7 @@ class AlarmService
|
||||
$payload = [
|
||||
'type' => $data['type'] ?? null,
|
||||
'severity' => $data['severity'] ?? null,
|
||||
'acknowledged' => $data['acknowledged'] ?? null,
|
||||
'acknowledged' => false,
|
||||
'cleared' => $data['cleared'] ?? Carbon::now()->timestamp,
|
||||
'startTs' => $data['startTs'] ?? Carbon::now()->timestamp,
|
||||
'endTs' => $data['endTs'] ?? Carbon::now()->timestamp,
|
||||
|
||||
Reference in New Issue
Block a user