get devices

This commit is contained in:
hannathkadher
2024-10-30 19:07:26 +04:00
parent 295013fd15
commit adacc60a40
15 changed files with 306 additions and 69 deletions

View File

@ -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;
}
}