fix: schedule device types

This commit is contained in:
Mhd Zayd Skaff
2025-06-29 15:26:22 +03:00
parent 8a4633b158
commit 4a7fac7b7a

View File

@ -50,7 +50,7 @@ export class ScheduleService {
// Corrected condition for supported device types
this.ensureProductTypeSupportedForSchedule(
ProductType[deviceDetails.productDevice.prodType],
deviceDetails.productDevice.prodType as ProductType,
);
return this.enableScheduleDeviceInTuya(
@ -74,7 +74,7 @@ export class ScheduleService {
// Corrected condition for supported device types
this.ensureProductTypeSupportedForSchedule(
ProductType[deviceDetails.productDevice.prodType],
deviceDetails.productDevice.prodType as ProductType,
);
return await this.deleteScheduleDeviceInTuya(
@ -97,7 +97,7 @@ export class ScheduleService {
}
this.ensureProductTypeSupportedForSchedule(
ProductType[deviceDetails.productDevice.prodType],
deviceDetails.productDevice.prodType as ProductType,
);
await this.addScheduleDeviceInTuya(
@ -120,9 +120,8 @@ export class ScheduleService {
}
// Corrected condition for supported device types
this.ensureProductTypeSupportedForSchedule(
ProductType[deviceDetails.productDevice.prodType],
deviceDetails.productDevice.prodType as ProductType,
);
const schedules = await this.getScheduleDeviceInTuya(
deviceDetails.deviceTuyaUuid,
category,
@ -162,7 +161,7 @@ export class ScheduleService {
// Corrected condition for supported device types
this.ensureProductTypeSupportedForSchedule(
ProductType[deviceDetails.productDevice.prodType],
deviceDetails.productDevice.prodType as ProductType,
);
await this.updateScheduleDeviceInTuya(