@cpzxrobot/sdk 1.2.42 → 1.2.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/device_gateway.ts CHANGED
@@ -344,6 +344,20 @@ export class DeviceGateway extends Object {
344
344
  });
345
345
  }
346
346
 
347
+ // 设备生产商 GET /api/v2/device/manufacturers
348
+ manufacturers(): Promise<any> {
349
+ return this.context.ready.then(() => {
350
+ return this.context.axios.get("/api/v2/device/manufacturers")
351
+ .then((res) => {
352
+ if (res.data.code != 200) {
353
+ throw res.data.message;
354
+ }
355
+ return res.data;
356
+ });
357
+ });
358
+ }
359
+
360
+
347
361
  get ctrl() {
348
362
  return {
349
363
  // 获取设备控制参数
@@ -370,6 +384,19 @@ export class DeviceGateway extends Object {
370
384
  return res.data;
371
385
  });
372
386
  });
387
+ },
388
+
389
+ //GET /api/v2/device/ctrl/{id}/{paramType}/configs
390
+ configs: (deviceId: number, type: string): Promise<any> => {
391
+ return this.context.ready.then(() => {
392
+ return this.context.axios.get(`/api/v2/device/ctrl/${deviceId}/${type}/configs`)
393
+ .then((res) => {
394
+ if (res.data.code != 200) {
395
+ throw res.data.message;
396
+ }
397
+ return res.data;
398
+ });
399
+ });
373
400
  }
374
401
  };
375
402
  }
@@ -27,4 +27,5 @@ export class DeviceTypeGateway {
27
27
  })
28
28
  });
29
29
  }
30
+
30
31
  }
@@ -2,3 +2,15 @@
2
2
 
3
3
  ## 最简易模型参考[这里](./normal.ts)
4
4
 
5
+ ## 接口说明
6
+
7
+ ### manufacturers 接口
8
+ - 功能:获取设备制造商列表
9
+ - 参数:无
10
+ - 返回:制造商信息数组
11
+
12
+ ### ctrl.config 接口
13
+ - 功能:配置设备控制参数
14
+ - 参数:
15
+ - `config`: 配置对象
16
+ - 返回:操作结果状态
@@ -252,6 +252,18 @@ class DeviceGateway extends Object {
252
252
  });
253
253
  });
254
254
  }
255
+ // 设备生产商 GET /api/v2/device/manufacturers
256
+ manufacturers() {
257
+ return this.context.ready.then(() => {
258
+ return this.context.axios.get("/api/v2/device/manufacturers")
259
+ .then((res) => {
260
+ if (res.data.code != 200) {
261
+ throw res.data.message;
262
+ }
263
+ return res.data;
264
+ });
265
+ });
266
+ }
255
267
  get ctrl() {
256
268
  return {
257
269
  // 获取设备控制参数
@@ -277,6 +289,18 @@ class DeviceGateway extends Object {
277
289
  return res.data;
278
290
  });
279
291
  });
292
+ },
293
+ //GET /api/v2/device/ctrl/{id}/{paramType}/configs
294
+ configs: (deviceId, type) => {
295
+ return this.context.ready.then(() => {
296
+ return this.context.axios.get(`/api/v2/device/ctrl/${deviceId}/${type}/configs`)
297
+ .then((res) => {
298
+ if (res.data.code != 200) {
299
+ throw res.data.message;
300
+ }
301
+ return res.data;
302
+ });
303
+ });
280
304
  }
281
305
  };
282
306
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.42",
3
+ "version": "1.2.43",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {