mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 21:14:55 +00:00
get devices
This commit is contained in:
@ -35,4 +35,21 @@ export class TuyaService {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async getDeviceDetails(deviceId: string) {
|
||||
const path = `/v1.1/iot-03/devices/${deviceId}`;
|
||||
const response = await this.tuya.request({
|
||||
method: 'GET',
|
||||
path,
|
||||
});
|
||||
|
||||
if (!response.success) {
|
||||
throw new HttpException(
|
||||
`Error fetching device details: ${response.msg}`,
|
||||
HttpStatus.BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
|
||||
return response.result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user