1
0
Fork 0
develop
李静 2023-07-27 15:52:32 +08:00
parent 151f7877e4
commit 8da20ed9ad
1 changed files with 17 additions and 0 deletions

View File

@ -68,6 +68,23 @@ class HttpClient
]);
}
/**
* 获取设备最新属性数据
*/
public function getDeviceStatus(string $deviceId, array $props): array
{
$result = $this->get('/api/deviceStatus/v1/getDeviceStatus', [
'deviceCode' => $deviceId,
'prop' => implode(",", $props),
]);
if (data_get($result, 'success') !== true) {
throw new RuntimeException(data_get($result, 'msg', '出错啦!'));
}
return $result['data'];
}
public function get(string $url, array $query = []): array
{
return $this->request('GET', $url, [