From c7a4ff119457d4bd749c7d62650dd46528da838a Mon Sep 17 00:00:00 2001 From: ZaydSkaff Date: Sun, 29 Jun 2025 15:27:55 +0300 Subject: [PATCH] fix: schedule device types (#441) --- src/schedule/services/schedule.service.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/schedule/services/schedule.service.ts b/src/schedule/services/schedule.service.ts index e4bd586..d88ee20 100644 --- a/src/schedule/services/schedule.service.ts +++ b/src/schedule/services/schedule.service.ts @@ -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(