mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
Refactor automation DTOs and service
This commit is contained in:
@ -5,7 +5,11 @@ import {
|
||||
BadRequestException,
|
||||
} from '@nestjs/common';
|
||||
import { SpaceRepository } from '@app/common/modules/space/repositories';
|
||||
import { UpdateAutomationDto, UpdateAutomationStatusDto } from '../dtos';
|
||||
import {
|
||||
AddAutomationDto,
|
||||
UpdateAutomationDto,
|
||||
UpdateAutomationStatusDto,
|
||||
} from '../dtos';
|
||||
import { GetUnitByUuidInterface } from 'src/unit/interface/unit.interface';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { TuyaContext } from '@tuya/tuya-connector-nodejs';
|
||||
@ -37,7 +41,7 @@ export class AutomationService {
|
||||
});
|
||||
}
|
||||
|
||||
async addAutomation(addAutomationDto, spaceTuyaId = null) {
|
||||
async addAutomation(addAutomationDto: AddAutomationDto, spaceTuyaId = null) {
|
||||
try {
|
||||
let unitSpaceTuyaId;
|
||||
if (!spaceTuyaId) {
|
||||
@ -88,7 +92,7 @@ export class AutomationService {
|
||||
path,
|
||||
body: {
|
||||
space_id: unitSpaceTuyaId,
|
||||
name: addAutomationDto.name,
|
||||
name: addAutomationDto.automationName,
|
||||
effective_time: {
|
||||
...addAutomationDto.effectiveTime,
|
||||
timezone_id: 'Asia/Dubai',
|
||||
|
Reference in New Issue
Block a user