mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 07:54:53 +00:00
Merge pull request #317 from SyncrowIOT/SP-1331-be-return-space-name-in-get-scene-and-get-automation-by-space-apis
SP-1331-be-return-space-name-in-get-scene-and-get-automation-by-space-apis
This commit is contained in:
@ -260,6 +260,8 @@ export class AutomationService {
|
||||
name: automationDetails.result.name,
|
||||
status: automationDetails.result.status,
|
||||
type: AUTOMATION_TYPE,
|
||||
spaceId: automation.space.uuid,
|
||||
spaceName: automation.space.spaceName,
|
||||
};
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
|
||||
@ -42,4 +42,5 @@ export interface SceneDetails {
|
||||
type: string;
|
||||
actions: Action[];
|
||||
spaceId: string;
|
||||
spaceName: string;
|
||||
}
|
||||
|
||||
@ -231,6 +231,8 @@ export class SceneService {
|
||||
|
||||
const safeFetch = async (scene: any) => {
|
||||
try {
|
||||
console.log('scene', scene);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { actions, ...sceneDetails } = await this.getScene(
|
||||
scene,
|
||||
@ -443,7 +445,7 @@ export class SceneService {
|
||||
}
|
||||
}
|
||||
|
||||
async getScene(scene: SceneEntity, sceneUuid: string): Promise<SceneDetails> {
|
||||
async getScene(scene: SceneEntity, spaceUuid: string): Promise<SceneDetails> {
|
||||
try {
|
||||
const { actions, name, status } = await this.fetchSceneDetailsFromTuya(
|
||||
scene.sceneTuyaUuid,
|
||||
@ -490,7 +492,8 @@ export class SceneService {
|
||||
showInHome: scene.showInHomePage,
|
||||
type: 'tap_to_run',
|
||||
actions,
|
||||
spaceId: sceneUuid,
|
||||
spaceId: spaceUuid,
|
||||
spaceName: scene.space.spaceName,
|
||||
};
|
||||
} catch (err) {
|
||||
if (err instanceof BadRequestException) {
|
||||
|
||||
Reference in New Issue
Block a user