信息采集接口

This commit is contained in:
chenbo 2024-01-29 10:06:15 +08:00
parent a9730932e8
commit fbababf4dc
1 changed files with 12 additions and 0 deletions

View File

@ -24,6 +24,9 @@ class RemoteRequestLogic extends BaseLogic
$datas['ambient_temperature'] = 0;
$datas['ambient_humidity'] = 0;
}
} else {
$datas['ambient_temperature'] = 0;
$datas['ambient_humidity'] = 0;
}
// 氮气 nitrogen
@ -32,6 +35,8 @@ class RemoteRequestLogic extends BaseLogic
$NMonitor = self::requestMqtt($NDevice);
if (!empty($NMonitor)) {
$datas['nitrogen'] = $NMonitor[1][2];
}else {
$datas['nitrogen'] = 0;
}
} else {
$datas['nitrogen'] = 0;
@ -43,6 +48,8 @@ class RemoteRequestLogic extends BaseLogic
$fireproofMonitor = self::requestMqtt($fireproofDevice);
if (!empty($fireproofMonitor)) {
$datas['fireproof'] = $fireproofMonitor[1][2];
} else {
$datas['fireproof'] = 0;
}
} else {
$datas['fireproof'] = 0;
@ -54,7 +61,10 @@ class RemoteRequestLogic extends BaseLogic
$methaneMonitor = self::requestMqtt($methaneDevice);
if (!empty($methaneMonitor)) {
$datas['methane'] = $methaneMonitor[1][2];
} else {
$datas['methane'] = 0;
}
} else {
$datas['methane'] = 0;
}
@ -65,6 +75,8 @@ class RemoteRequestLogic extends BaseLogic
$noiseMonitor = self::requestMqtt($noiseDevice);
if (!empty($noiseMonitor)) {
$datas['noise'] = $noiseMonitor[1][2];
} else {
$datas['noise'] = 0;
}
} else {
$datas['noise'] = 0;