移块上云插件文档
    正在准备搜索索引...

    智能场景管理

    索引

    属性

    injectName: "scene" = 'scene'

    方法

    • 批量添加常用场景

      参数

      • options: {
            complete: () => void;
            fail: (res: Error) => void;
            fid: string;
            sceneIdList: string[];
            success: (res: ResponseData) => void;
        }
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • fid: string

          家庭id

        • sceneIdList: string[]

          场景id列表

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.batchAddCommonScene({
      fid:'',
      sceneIdList:[''],
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 批量移除常用场景

      参数

      • options: {
            complete: () => void;
            fail: (res: Error) => void;
            fid: string;
            sceneIdList: string[];
            success: (res: ResponseData) => void;
        }
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • fid: string

          家庭id

        • sceneIdList: string[]

          场景id列表

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.batchDeleteCommonScene({
      fid:'',
      sceneIdList:[''],
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 删除用户下场景日志

      参数

      • options: {
            complete: () => void;
            fail: (res: Error) => void;
            fid: string;
            success: (res: ResponseData) => void;
        }
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • fid: string

          家庭id

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.deleteSceneLog({
      fid:'',
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 创建场景

      参数

      • options: {
            arr: SceneCreationConfig[];
            complete: () => void;
            fail: (res: Error) => void;
            success: (res: ResponseData) => void;
        }
        • arr: SceneCreationConfig[]
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.sceneCreate({
      {
      fid:'',
      isCommon:false,
      sceneInfo:{
      icon:'',
      id:'',
      name:'',
      sceneId:'',
      metaDataList:[{
      deviceKey:'',
      deviceName:'',
      logoImage:'',
      productKey:'',
      actionList:[{
      actionId:''
      code:''
      dataType:''
      id:''
      name:''
      subName:''
      subType:''
      type:''
      unit:''
      value:''
      }]
      }]
      }
      },
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 删除场景 删除用户下场景日志

      参数

      • options: {
            complete: () => void;
            fail: (res: Error) => void;
            fid?: string;
            sceneId?: string;
            success: (res: ResponseData) => void;
        }
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • 可选fid?: string

          家庭id

        • 可选sceneId?: string

          场景id

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.sceneDelete({
      fid:'',
      sceneId:'',
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 编辑场景

      参数

      • options: {
            arr: SceneCreationConfig[];
            complete: () => void;
            fail: (res: Error) => void;
            success: (res: ResponseData) => void;
        }
        • arr: SceneCreationConfig[]
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.sceneEdit({
      {
      fid:'',
      isCommon:false,
      sceneInfo:{
      icon:'',
      id:'',
      name:'',
      sceneId:'',
      metaDataList:[{
      deviceKey:'',
      deviceName:'',
      logoImage:'',
      productKey:'',
      actionList:[{
      actionId:''
      code:''
      dataType:''
      id:''
      name:''
      subName:''
      subType:''
      type:''
      unit:''
      value:''
      }]
      }]
      }
      },
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 执行场景

      参数

      • options: {
            complete: () => void;
            fail: (res: Error) => void;
            fid?: string;
            sceneId?: string;
            success: (res: ResponseData) => void;
        }
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • 可选fid?: string

          家庭id

        • 可选sceneId?: string

          场景id

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.sceneExecute({
      fid:'',
      sceneId:'',
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 测试场景

      参数

      • options: {
            arr: SceneCreationConfig[];
            complete: () => void;
            fail: (res: Error) => void;
            success: (res: ResponseData) => void;
        }
        • arr: SceneCreationConfig[]
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.sceneTest({
      {
      fid:'',
      isCommon:false,
      sceneInfo:{
      icon:'',
      id:'',
      name:'',
      sceneId:'',
      metaDataList:[{
      deviceKey:'',
      deviceName:'',
      logoImage:'',
      productKey:'',
      actionList:[{
      actionId:''
      code:''
      dataType:''
      id:''
      name:''
      subName:''
      subType:''
      type:''
      unit:''
      value:''
      }]
      }]
      }
      },
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 查询常用场景

      参数

      • options: {
            complete: () => void;
            fail: (res: Error) => void;
            fid?: string;
            page: number;
            pageSize: string;
            success: (res: ResponseData) => void;
        }
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • 可选fid?: string

          家庭id

        • page: number

          当前页,默认为第 1 页

        • pageSize: string

          页大小,默认为 10 条

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.selectCommonSceneList({
      fid:'',
      page:1,
      pageSize:10,
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 查询场景

      参数

      • options: {
            complete: () => void;
            fail: (res: Error) => void;
            fid?: string;
            sceneId?: string;
            success: (res: ResponseData) => void;
        }
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • 可选fid?: string

          家庭id

        • 可选sceneId?: string

          场景id

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.selectSceneDetail({
      fid:'',
      sceneId:'',
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 查询场景列表

      参数

      • options: {
            complete: () => void;
            fail: (res: Error) => void;
            fid?: string;
            page: number;
            pageSize: string;
            sceneName?: string;
            success: (res: ResponseData) => void;
        }
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • 可选fid?: string

          家庭id

        • page: number

          当前页,默认为第 1 页

        • pageSize: string

          页大小,默认为 10 条

        • 可选sceneName?: string

          场景名称

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.selectSceneList({
      fid:'',
      sceneName:'',
      page:1,
      pageSize:10,
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 根据executionId查询日志详情

      参数

      • options: {
            complete: () => void;
            executionId?: number;
            fail: (res: Error) => void;
            success: (res: ResponseData) => void;
        }
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • 可选executionId?: number

          场景 id

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.selectSceneLogDetail({
      fid:'',
      sceneId:'',
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })
    • 查询用户下场景日志列表

      参数

      • options: {
            complete: () => void;
            fail: (res: Error) => void;
            fid?: string;
            lastExecutionId?: number;
            limit?: number;
            success: (res: ResponseData) => void;
        }
        • complete: () => void

          接口调用结束的回调函数(调用成功、失败都会执行)

        • fail: (res: Error) => void

          接口调用失败的回调函数

        • 可选fid?: string

          家庭id

        • 可选lastExecutionId?: number

          executionId

        • 可选limit?: number

          限制个数

        • success: (res: ResponseData) => void

          接口调用成功的回调函数

      返回 void

      const plugin = requirePlugin('quecPlugin')
      plugin.scene.selectSceneLogList({
      fid:'',
      executionId:10,
      limit:10
      success (res) {
      console.log(res)
      },
      fail (res) {
      console.log(JSON.stringify(res))
      }
      })