Update
parent
151f7877e4
commit
8da20ed9ad
|
|
@ -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, [
|
||||
|
|
|
|||
Loading…
Reference in New Issue