mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
Refactor getDevicesInstructionStatus method for improved readability
This commit is contained in:
@ -381,12 +381,18 @@ export class DeviceService {
|
||||
}
|
||||
async getDevicesInstructionStatus(deviceId: string) {
|
||||
try {
|
||||
const response = await this.getDevicesInstructionStatusTuya(deviceId);
|
||||
|
||||
const deviceStatus = await this.getDevicesInstructionStatusTuya(deviceId);
|
||||
const productId: string = await this.getProductIdByDeviceId(deviceId);
|
||||
const productType: string =
|
||||
await this.getProductTypeByProductId(productId);
|
||||
return {
|
||||
result: response.result,
|
||||
success: response.success,
|
||||
msg: response.msg,
|
||||
result: {
|
||||
productId: productId,
|
||||
productType: productType,
|
||||
status: deviceStatus.result[0].status,
|
||||
},
|
||||
success: deviceStatus.success,
|
||||
msg: deviceStatus.msg,
|
||||
};
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
|
Reference in New Issue
Block a user