mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 20:54:53 +00:00
finished 4scene configration endpoints
This commit is contained in:
@ -9,6 +9,12 @@ import { DeviceRepository } from '@app/common/modules/device/repositories';
|
||||
import { ProductRepository } from '@app/common/modules/product/repositories';
|
||||
import { DeviceStatusFirebaseModule } from '@app/common/firebase/devices-status/devices-status.module';
|
||||
import { TuyaService } from '@app/common/integrations/tuya/services/tuya.service';
|
||||
import { SceneService } from 'src/scene/services';
|
||||
import {
|
||||
SceneIconRepository,
|
||||
SceneRepository,
|
||||
} from '@app/common/modules/scene/repositories';
|
||||
import { SceneDeviceRepository } from '@app/common/modules/scene-device/repositories';
|
||||
|
||||
@Module({
|
||||
imports: [ConfigModule, SpaceRepositoryModule, DeviceStatusFirebaseModule],
|
||||
@ -20,6 +26,10 @@ import { TuyaService } from '@app/common/integrations/tuya/services/tuya.service
|
||||
DeviceService,
|
||||
DeviceRepository,
|
||||
ProductRepository,
|
||||
SceneService,
|
||||
SceneIconRepository,
|
||||
SceneRepository,
|
||||
SceneDeviceRepository,
|
||||
],
|
||||
exports: [AutomationService],
|
||||
})
|
||||
|
||||
@ -30,6 +30,7 @@ import {
|
||||
} from '@app/common/constants/automation.enum';
|
||||
import { TuyaService } from '@app/common/integrations/tuya/services/tuya.service';
|
||||
import { ConvertedAction } from '@app/common/integrations/tuya/interfaces';
|
||||
import { SceneDeviceRepository } from '@app/common/modules/scene-device/repositories';
|
||||
|
||||
@Injectable()
|
||||
export class AutomationService {
|
||||
@ -39,6 +40,7 @@ export class AutomationService {
|
||||
private readonly spaceRepository: SpaceRepository,
|
||||
private readonly deviceService: DeviceService,
|
||||
private readonly tuyaService: TuyaService,
|
||||
private readonly sceneDeviceRepository: SceneDeviceRepository,
|
||||
) {
|
||||
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
||||
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
||||
@ -304,6 +306,16 @@ export class AutomationService {
|
||||
HttpStatus.BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
const existingSceneDevice = await this.sceneDeviceRepository.findOne({
|
||||
where: { automationTuyaUuid: automationUuid },
|
||||
});
|
||||
|
||||
if (existingSceneDevice) {
|
||||
await this.sceneDeviceRepository.delete({
|
||||
automationTuyaUuid: automationUuid,
|
||||
});
|
||||
}
|
||||
|
||||
const response = this.tuyaService.deleteAutomation(
|
||||
automation.spaceId,
|
||||
automationUuid,
|
||||
@ -323,6 +335,15 @@ export class AutomationService {
|
||||
|
||||
async delete(tuyaSpaceId: string, automationUuid: string) {
|
||||
try {
|
||||
const existingSceneDevice = await this.sceneDeviceRepository.findOne({
|
||||
where: { automationTuyaUuid: automationUuid },
|
||||
});
|
||||
|
||||
if (existingSceneDevice) {
|
||||
await this.sceneDeviceRepository.delete({
|
||||
automationTuyaUuid: automationUuid,
|
||||
});
|
||||
}
|
||||
const response = await this.tuyaService.deleteAutomation(
|
||||
tuyaSpaceId,
|
||||
automationUuid,
|
||||
|
||||
@ -12,13 +12,18 @@ import {
|
||||
Put,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { AddDeviceDto, UpdateDeviceInSpaceDto } from '../dtos/add.device.dto';
|
||||
import {
|
||||
AddDeviceDto,
|
||||
AddSceneToFourSceneDeviceDto,
|
||||
UpdateDeviceInSpaceDto,
|
||||
} from '../dtos/add.device.dto';
|
||||
import { GetDeviceLogsDto } from '../dtos/get.device.dto';
|
||||
import {
|
||||
ControlDeviceDto,
|
||||
BatchControlDevicesDto,
|
||||
BatchStatusDevicesDto,
|
||||
BatchFactoryResetDevicesDto,
|
||||
GetSceneFourSceneDeviceDto,
|
||||
} from '../dtos/control.device.dto';
|
||||
import { CheckRoomGuard } from 'src/guards/room.guard';
|
||||
import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard';
|
||||
@ -184,4 +189,35 @@ export class DeviceController {
|
||||
powerClampUuid,
|
||||
);
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('four-scene/:deviceUuid')
|
||||
async addSceneToFourSceneDevice(
|
||||
@Param('deviceUuid') deviceUuid: string,
|
||||
@Body() addSceneToFourSceneDeviceDto: AddSceneToFourSceneDeviceDto,
|
||||
) {
|
||||
const device = await this.deviceService.addSceneToFourSceneDevice(
|
||||
deviceUuid,
|
||||
addSceneToFourSceneDeviceDto,
|
||||
);
|
||||
|
||||
return {
|
||||
statusCode: HttpStatus.CREATED,
|
||||
success: true,
|
||||
message: `scene added successfully to device ${deviceUuid}`,
|
||||
data: device,
|
||||
};
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('four-scene/:deviceUuid')
|
||||
async getSceneFourSceneDevice(
|
||||
@Param('deviceUuid') deviceUuid: string,
|
||||
@Query() getSceneFourSceneDeviceDto: GetSceneFourSceneDeviceDto,
|
||||
) {
|
||||
return await this.deviceService.getSceneFourSceneDevice(
|
||||
deviceUuid,
|
||||
getSceneFourSceneDeviceDto,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,9 +11,18 @@ import { SpaceRepository } from '@app/common/modules/space/repositories';
|
||||
import { DeviceUserPermissionRepository } from '@app/common/modules/device/repositories';
|
||||
import { UserRepository } from '@app/common/modules/user/repositories';
|
||||
import { DeviceStatusFirebaseModule } from '@app/common/firebase/devices-status/devices-status.module';
|
||||
import { SpaceModule } from 'src/space/space.module';
|
||||
import { TuyaService } from '@app/common/integrations/tuya/services/tuya.service';
|
||||
import { SceneService } from 'src/scene/services';
|
||||
import {
|
||||
SceneIconRepository,
|
||||
SceneRepository,
|
||||
} from '@app/common/modules/scene/repositories';
|
||||
import { SceneDeviceRepository } from '@app/common/modules/scene-device/repositories';
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule,
|
||||
SpaceModule,
|
||||
ProductRepositoryModule,
|
||||
DeviceRepositoryModule,
|
||||
DeviceStatusFirebaseModule,
|
||||
@ -27,6 +36,11 @@ import { DeviceStatusFirebaseModule } from '@app/common/firebase/devices-status/
|
||||
SpaceRepository,
|
||||
DeviceRepository,
|
||||
UserRepository,
|
||||
TuyaService,
|
||||
SceneService,
|
||||
SceneIconRepository,
|
||||
SceneRepository,
|
||||
SceneDeviceRepository,
|
||||
],
|
||||
exports: [DeviceService],
|
||||
})
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { FourSceneSwitchesEnum } from '@app/common/constants/four-scene.enum';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
import { IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
export class AddDeviceDto {
|
||||
@ApiProperty({
|
||||
@ -35,3 +36,27 @@ export class UpdateDeviceInSpaceDto {
|
||||
@IsNotEmpty()
|
||||
public spaceUuid: string;
|
||||
}
|
||||
export class AddSceneToFourSceneDeviceDto {
|
||||
@ApiProperty({
|
||||
description: 'switchName',
|
||||
required: true,
|
||||
})
|
||||
@IsEnum(FourSceneSwitchesEnum)
|
||||
@IsNotEmpty()
|
||||
switchName: FourSceneSwitchesEnum;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'sceneUuid',
|
||||
required: true,
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public sceneUuid: string;
|
||||
@ApiProperty({
|
||||
description: 'spaceUuid',
|
||||
required: true,
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public spaceUuid: string;
|
||||
}
|
||||
|
||||
@ -54,3 +54,12 @@ export class BatchFactoryResetDevicesDto {
|
||||
@IsNotEmpty()
|
||||
public devicesUuid: [string];
|
||||
}
|
||||
export class GetSceneFourSceneDeviceDto {
|
||||
@ApiProperty({
|
||||
description: 'switchName',
|
||||
required: true,
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public switchName: string;
|
||||
}
|
||||
|
||||
@ -5,10 +5,16 @@ import {
|
||||
HttpStatus,
|
||||
NotFoundException,
|
||||
BadRequestException,
|
||||
forwardRef,
|
||||
Inject,
|
||||
} from '@nestjs/common';
|
||||
import { TuyaContext } from '@tuya/tuya-connector-nodejs';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { AddDeviceDto, UpdateDeviceInSpaceDto } from '../dtos/add.device.dto';
|
||||
import {
|
||||
AddDeviceDto,
|
||||
AddSceneToFourSceneDeviceDto,
|
||||
UpdateDeviceInSpaceDto,
|
||||
} from '../dtos/add.device.dto';
|
||||
import {
|
||||
DeviceInstructionResponse,
|
||||
GetDeviceDetailsFunctionsInterface,
|
||||
@ -28,6 +34,7 @@ import {
|
||||
BatchFactoryResetDevicesDto,
|
||||
BatchStatusDevicesDto,
|
||||
ControlDeviceDto,
|
||||
GetSceneFourSceneDeviceDto,
|
||||
} from '../dtos/control.device.dto';
|
||||
import { convertKeysToCamelCase } from '@app/common/helper/camelCaseConverter';
|
||||
import { DeviceRepository } from '@app/common/modules/device/repositories';
|
||||
@ -40,6 +47,11 @@ import { DeviceStatuses } from '@app/common/constants/device-status.enum';
|
||||
import { CommonErrorCodes } from '@app/common/constants/error-codes.enum';
|
||||
import { BatteryStatus } from '@app/common/constants/battery-status.enum';
|
||||
import { SpaceEntity } from '@app/common/modules/space/entities';
|
||||
import { SceneService } from 'src/scene/services';
|
||||
import { AddAutomationDto } from 'src/automation/dtos';
|
||||
import { TuyaService } from '@app/common/integrations/tuya/services/tuya.service';
|
||||
import { SceneDeviceRepository } from '@app/common/modules/scene-device/repositories';
|
||||
import { FourSceneSwitchesEnum } from '@app/common/constants/four-scene.enum';
|
||||
|
||||
@Injectable()
|
||||
export class DeviceService {
|
||||
@ -47,9 +59,13 @@ export class DeviceService {
|
||||
constructor(
|
||||
private readonly configService: ConfigService,
|
||||
private readonly deviceRepository: DeviceRepository,
|
||||
private readonly sceneDeviceRepository: SceneDeviceRepository,
|
||||
private readonly productRepository: ProductRepository,
|
||||
private readonly deviceStatusFirebaseService: DeviceStatusFirebaseService,
|
||||
private readonly spaceRepository: SpaceRepository,
|
||||
@Inject(forwardRef(() => SceneService))
|
||||
private readonly sceneService: SceneService,
|
||||
private readonly tuyaService: TuyaService,
|
||||
) {
|
||||
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
||||
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
||||
@ -630,7 +646,6 @@ export class DeviceService {
|
||||
status: deviceStatus.result[0].status,
|
||||
};
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
throw new HttpException(
|
||||
'Error fetching device functions status',
|
||||
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
@ -1136,4 +1151,134 @@ export class DeviceService {
|
||||
|
||||
return descendants;
|
||||
}
|
||||
async addSceneToFourSceneDevice(
|
||||
deviceUuid: string,
|
||||
addSceneToFourSceneDeviceDto: AddSceneToFourSceneDeviceDto,
|
||||
) {
|
||||
try {
|
||||
const { spaceUuid, sceneUuid, switchName } = addSceneToFourSceneDeviceDto;
|
||||
|
||||
if (!spaceUuid || !sceneUuid || !switchName) {
|
||||
throw new BadRequestException('Missing required fields in DTO');
|
||||
}
|
||||
|
||||
const [sceneData, spaceData, deviceData] = await Promise.all([
|
||||
this.sceneService.findScene(sceneUuid),
|
||||
this.sceneService.getSpaceByUuid(spaceUuid),
|
||||
this.getDeviceByDeviceUuid(deviceUuid),
|
||||
]);
|
||||
|
||||
// Generate a shorter automation name (e.g., "Auto_ABC123_169")
|
||||
const shortUuid = deviceUuid.slice(0, 6); // First 6 characters of the UUID
|
||||
const timestamp = Math.floor(Date.now() / 1000); // Current timestamp in seconds
|
||||
const automationName = `Auto_${shortUuid}_${timestamp}`;
|
||||
|
||||
const addAutomationData: AddAutomationDto = {
|
||||
spaceUuid: spaceData.spaceTuyaUuid,
|
||||
automationName,
|
||||
decisionExpr: 'and',
|
||||
effectiveTime: {
|
||||
start: '00:00',
|
||||
end: '23:59',
|
||||
loops: '1111111',
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
code: 1,
|
||||
entityId: deviceData.deviceTuyaUuid,
|
||||
entityType: 'device_report',
|
||||
expr: {
|
||||
comparator: '==',
|
||||
statusCode: switchName,
|
||||
statusValue: 'scene',
|
||||
},
|
||||
},
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
actionExecutor: 'rule_trigger',
|
||||
entityId: sceneData.sceneTuyaUuid,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// Create automation
|
||||
const automation = await this.tuyaService.createAutomation(
|
||||
addAutomationData.spaceUuid,
|
||||
addAutomationData.automationName,
|
||||
addAutomationData.effectiveTime,
|
||||
addAutomationData.decisionExpr,
|
||||
addAutomationData.conditions,
|
||||
addAutomationData.actions,
|
||||
);
|
||||
|
||||
if (automation.success) {
|
||||
const existingSceneDevice = await this.sceneDeviceRepository.findOne({
|
||||
where: {
|
||||
device: { uuid: deviceUuid },
|
||||
scene: { uuid: sceneUuid },
|
||||
switchName: switchName,
|
||||
},
|
||||
relations: ['scene', 'device'],
|
||||
});
|
||||
|
||||
if (existingSceneDevice) {
|
||||
await this.tuyaService.deleteAutomation(
|
||||
spaceData.spaceTuyaUuid,
|
||||
existingSceneDevice.automationTuyaUuid,
|
||||
);
|
||||
|
||||
existingSceneDevice.automationTuyaUuid = automation.result.id;
|
||||
existingSceneDevice.scene = sceneData;
|
||||
existingSceneDevice.device = deviceData;
|
||||
existingSceneDevice.switchName = switchName;
|
||||
|
||||
return await this.sceneDeviceRepository.save(existingSceneDevice);
|
||||
} else {
|
||||
const sceneDevice = await this.sceneDeviceRepository.save({
|
||||
scene: sceneData,
|
||||
device: deviceData,
|
||||
automationTuyaUuid: automation.result.id,
|
||||
switchName: switchName,
|
||||
});
|
||||
return sceneDevice;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
const errorMessage = err.message || 'Error creating automation';
|
||||
const errorStatus = err.status || HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
throw new HttpException(errorMessage, errorStatus);
|
||||
}
|
||||
}
|
||||
async getSceneFourSceneDevice(
|
||||
deviceUuid: string,
|
||||
getSceneFourSceneDeviceDto: GetSceneFourSceneDeviceDto,
|
||||
) {
|
||||
try {
|
||||
const sceneDevice = await this.sceneDeviceRepository.findOne({
|
||||
where: {
|
||||
device: { uuid: deviceUuid },
|
||||
switchName:
|
||||
getSceneFourSceneDeviceDto.switchName as FourSceneSwitchesEnum, // Cast the string to the enum
|
||||
},
|
||||
relations: ['device', 'scene'],
|
||||
});
|
||||
if (sceneDevice.uuid) {
|
||||
const SceneDetails = await this.sceneService.getSceneByUuid(
|
||||
sceneDevice.scene.uuid,
|
||||
);
|
||||
return {
|
||||
switchName: sceneDevice.switchName,
|
||||
createdAt: sceneDevice.createdAt,
|
||||
updatedAt: sceneDevice.updatedAt,
|
||||
deviceUuid: sceneDevice.device.uuid,
|
||||
scene: {
|
||||
...SceneDetails.data,
|
||||
},
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
throw new HttpException('Scene device not found', HttpStatus.NOT_FOUND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,13 @@ import { ProductRepository } from '@app/common/modules/product/repositories';
|
||||
import { DeviceStatusFirebaseService } from '@app/common/firebase/devices-status/services/devices-status.service';
|
||||
import { SpaceRepository } from '@app/common/modules/space/repositories';
|
||||
import { DeviceStatusLogRepository } from '@app/common/modules/device-status-log/repositories';
|
||||
import { TuyaService } from '@app/common/integrations/tuya/services/tuya.service';
|
||||
import { SceneService } from 'src/scene/services';
|
||||
import {
|
||||
SceneIconRepository,
|
||||
SceneRepository,
|
||||
} from '@app/common/modules/scene/repositories';
|
||||
import { SceneDeviceRepository } from '@app/common/modules/scene-device/repositories';
|
||||
@Module({
|
||||
imports: [ConfigModule, DeviceRepositoryModule],
|
||||
controllers: [DoorLockController],
|
||||
@ -24,6 +31,11 @@ import { DeviceStatusLogRepository } from '@app/common/modules/device-status-log
|
||||
DeviceStatusFirebaseService,
|
||||
SpaceRepository,
|
||||
DeviceStatusLogRepository,
|
||||
TuyaService,
|
||||
SceneService,
|
||||
SceneIconRepository,
|
||||
SceneRepository,
|
||||
SceneDeviceRepository,
|
||||
],
|
||||
exports: [DoorLockService],
|
||||
})
|
||||
|
||||
@ -120,7 +120,6 @@ export class GroupService {
|
||||
throw new HttpException('No devices found', HttpStatus.NOT_FOUND);
|
||||
return devices.flat(); // Flatten the array since flatMap was used
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
throw new HttpException(
|
||||
'This space does not have any devices for the specified group name',
|
||||
HttpStatus.NOT_FOUND,
|
||||
|
||||
@ -13,6 +13,7 @@ import {
|
||||
SceneRepository,
|
||||
} from '@app/common/modules/scene/repositories';
|
||||
import { TuyaService } from '@app/common/integrations/tuya/services/tuya.service';
|
||||
import { SceneDeviceRepository } from '@app/common/modules/scene-device/repositories';
|
||||
|
||||
@Module({
|
||||
imports: [ConfigModule, SpaceRepositoryModule, DeviceStatusFirebaseModule],
|
||||
@ -26,6 +27,7 @@ import { TuyaService } from '@app/common/integrations/tuya/services/tuya.service
|
||||
ProductRepository,
|
||||
SceneIconRepository,
|
||||
SceneRepository,
|
||||
SceneDeviceRepository,
|
||||
],
|
||||
exports: [SceneService],
|
||||
})
|
||||
|
||||
@ -3,6 +3,8 @@ import {
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
BadRequestException,
|
||||
forwardRef,
|
||||
Inject,
|
||||
} from '@nestjs/common';
|
||||
import { SpaceRepository } from '@app/common/modules/space/repositories';
|
||||
import {
|
||||
@ -14,7 +16,6 @@ import {
|
||||
UpdateSceneTapToRunDto,
|
||||
} from '../dtos';
|
||||
import { convertKeysToSnakeCase } from '@app/common/helper/snakeCaseConverter';
|
||||
import { DeviceService } from 'src/device/services';
|
||||
import {
|
||||
AddTapToRunSceneInterface,
|
||||
DeleteTapToRunSceneInterface,
|
||||
@ -37,6 +38,7 @@ import { BaseResponseDto } from '@app/common/dto/base.response.dto';
|
||||
import { SuccessResponseDto } from '@app/common/dto/success.response.dto';
|
||||
import { HttpStatusCode } from 'axios';
|
||||
import { ConvertedAction } from '@app/common/integrations/tuya/interfaces';
|
||||
import { DeviceService } from 'src/device/services';
|
||||
|
||||
@Injectable()
|
||||
export class SceneService {
|
||||
@ -44,8 +46,9 @@ export class SceneService {
|
||||
private readonly spaceRepository: SpaceRepository,
|
||||
private readonly sceneIconRepository: SceneIconRepository,
|
||||
private readonly sceneRepository: SceneRepository,
|
||||
private readonly deviceService: DeviceService,
|
||||
private readonly tuyaService: TuyaService,
|
||||
@Inject(forwardRef(() => DeviceService))
|
||||
private readonly deviceService: DeviceService,
|
||||
) {}
|
||||
|
||||
async createScene(
|
||||
@ -178,7 +181,10 @@ export class SceneService {
|
||||
});
|
||||
|
||||
if (!scenesData.length) {
|
||||
return [];
|
||||
throw new HttpException(
|
||||
`No scenes found for space UUID ${spaceUuid} with showInHomePage ${showInHomePage} `,
|
||||
HttpStatus.NOT_FOUND,
|
||||
);
|
||||
}
|
||||
|
||||
const scenes = await Promise.all(
|
||||
@ -438,7 +444,6 @@ export class SceneService {
|
||||
if (err instanceof BadRequestException) {
|
||||
throw err;
|
||||
} else {
|
||||
console.log(err);
|
||||
throw new HttpException(
|
||||
`An error occurred while retrieving scene details for ${scene.uuid}`,
|
||||
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
@ -454,9 +459,6 @@ export class SceneService {
|
||||
const space = await this.getSpaceByUuid(scene.spaceUuid);
|
||||
|
||||
await this.delete(scene.sceneTuyaUuid, space.spaceTuyaUuid);
|
||||
|
||||
await this.sceneRepository.remove(scene);
|
||||
|
||||
return new SuccessResponseDto({
|
||||
message: `Scene with ID ${sceneUuid} deleted successfully`,
|
||||
});
|
||||
@ -564,7 +566,6 @@ export class SceneService {
|
||||
};
|
||||
} catch (err) {
|
||||
if (err instanceof BadRequestException) {
|
||||
console.log(err);
|
||||
throw err;
|
||||
} else {
|
||||
throw new HttpException(
|
||||
|
||||
@ -37,6 +37,7 @@ import {
|
||||
import { DeviceService } from 'src/device/services';
|
||||
import { DeviceStatusFirebaseService } from '@app/common/firebase/devices-status/services/devices-status.service';
|
||||
import { DeviceStatusLogRepository } from '@app/common/modules/device-status-log/repositories';
|
||||
import { SceneDeviceRepository } from '@app/common/modules/scene-device/repositories';
|
||||
|
||||
@Module({
|
||||
imports: [ConfigModule, SpaceRepositoryModule],
|
||||
@ -69,6 +70,7 @@ import { DeviceStatusLogRepository } from '@app/common/modules/device-status-log
|
||||
DeviceService,
|
||||
DeviceStatusFirebaseService,
|
||||
DeviceStatusLogRepository,
|
||||
SceneDeviceRepository,
|
||||
],
|
||||
exports: [SpaceService],
|
||||
})
|
||||
|
||||
@ -13,6 +13,13 @@ import { DeviceStatusFirebaseService } from '@app/common/firebase/devices-status
|
||||
import { SpaceRepository } from '@app/common/modules/space/repositories';
|
||||
import { VisitorPasswordRepository } from '@app/common/modules/visitor-password/repositories';
|
||||
import { DeviceStatusLogRepository } from '@app/common/modules/device-status-log/repositories';
|
||||
import { TuyaService } from '@app/common/integrations/tuya/services/tuya.service';
|
||||
import { SceneService } from 'src/scene/services';
|
||||
import {
|
||||
SceneIconRepository,
|
||||
SceneRepository,
|
||||
} from '@app/common/modules/scene/repositories';
|
||||
import { SceneDeviceRepository } from '@app/common/modules/scene-device/repositories';
|
||||
@Module({
|
||||
imports: [ConfigModule, DeviceRepositoryModule, DoorLockModule],
|
||||
controllers: [VisitorPasswordController],
|
||||
@ -27,6 +34,11 @@ import { DeviceStatusLogRepository } from '@app/common/modules/device-status-log
|
||||
DeviceRepository,
|
||||
VisitorPasswordRepository,
|
||||
DeviceStatusLogRepository,
|
||||
TuyaService,
|
||||
SceneService,
|
||||
SceneIconRepository,
|
||||
SceneRepository,
|
||||
SceneDeviceRepository,
|
||||
],
|
||||
exports: [VisitorPasswordService],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user