Update
parent
cf7c12e01b
commit
c229cb736a
|
|
@ -380,7 +380,9 @@ class DeviceController extends Controller
|
|||
$x[] = $monitoredAt;
|
||||
|
||||
if ($monitoringLog) {
|
||||
if (is_null($value = $device->{$deviceColumn})) {
|
||||
$value = $monitoringLog->{$deviceColumn};
|
||||
|
||||
if (is_null($value) && $device->supplier_key === 'device-supplier-linkos') {
|
||||
$value = match ($deviceColumn) {
|
||||
'ph' => 7.49,
|
||||
'temperature' => 10.00,
|
||||
|
|
@ -390,7 +392,7 @@ class DeviceController extends Controller
|
|||
}
|
||||
|
||||
$y[] = $value;
|
||||
} else {
|
||||
} elseif ($device->supplier_key === 'device-supplier-linkos') {
|
||||
$y[] = match ($deviceColumn) {
|
||||
'chlorine' => 0.016,
|
||||
'conductivity' => 563,
|
||||
|
|
@ -400,6 +402,8 @@ class DeviceController extends Controller
|
|||
'turbidity' => 0.33,
|
||||
default => null,
|
||||
};
|
||||
} else {
|
||||
$y[] = null;
|
||||
}
|
||||
|
||||
$startAt->addHours(1);
|
||||
|
|
@ -592,7 +596,7 @@ class DeviceController extends Controller
|
|||
|
||||
if (is_null($monitoringLog)) {
|
||||
// 如果是水质设备,则写死假数据
|
||||
if($device->type == DeviceType::WaterQuality){
|
||||
if($device->supplier_key === 'device-supplier-linkos' && $device->type == DeviceType::WaterQuality){
|
||||
switch($field){
|
||||
case 'chlorine':
|
||||
$data[$key] = 0.016;
|
||||
|
|
|
|||
Loading…
Reference in New Issue