mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 10:54:55 +00:00
add space name to get scenes endpoint
This commit is contained in:
@ -42,4 +42,5 @@ export interface SceneDetails {
|
|||||||
type: string;
|
type: string;
|
||||||
actions: Action[];
|
actions: Action[];
|
||||||
spaceId: string;
|
spaceId: string;
|
||||||
|
spaceName: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -231,6 +231,8 @@ export class SceneService {
|
|||||||
|
|
||||||
const safeFetch = async (scene: any) => {
|
const safeFetch = async (scene: any) => {
|
||||||
try {
|
try {
|
||||||
|
console.log('scene', scene);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const { actions, ...sceneDetails } = await this.getScene(
|
const { actions, ...sceneDetails } = await this.getScene(
|
||||||
scene,
|
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 {
|
try {
|
||||||
const { actions, name, status } = await this.fetchSceneDetailsFromTuya(
|
const { actions, name, status } = await this.fetchSceneDetailsFromTuya(
|
||||||
scene.sceneTuyaUuid,
|
scene.sceneTuyaUuid,
|
||||||
@ -490,7 +492,8 @@ export class SceneService {
|
|||||||
showInHome: scene.showInHomePage,
|
showInHome: scene.showInHomePage,
|
||||||
type: 'tap_to_run',
|
type: 'tap_to_run',
|
||||||
actions,
|
actions,
|
||||||
spaceId: sceneUuid,
|
spaceId: spaceUuid,
|
||||||
|
spaceName: scene.space.spaceName,
|
||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof BadRequestException) {
|
if (err instanceof BadRequestException) {
|
||||||
|
|||||||
Reference in New Issue
Block a user