@cpzxrobot/sdk 1.0.46 → 1.0.47

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.
@@ -77,6 +77,11 @@ class PigfarmGateway extends Object {
77
77
  var axios = await this.context.ready;
78
78
  return axios.post(`/api/v1/pigfarm/heatLamp/list/${unit.id}`);
79
79
  },
80
+ //返回物联网相关的字段
81
+ iotFields: async (lamp) => {
82
+ var axios = await this.context.ready;
83
+ return axios.post(`/api/v1/pigfarm/heatLamp/iotFields/${lamp.id}`);
84
+ },
80
85
  //开关,传入id或对象,action为on或off
81
86
  switch: async (lamp, action) => {
82
87
  var axios = await this.context.ready;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -93,6 +93,13 @@ export class PigfarmGateway extends Object {
93
93
  `/api/v1/pigfarm/heatLamp/list/${unit.id}`
94
94
  );
95
95
  },
96
+ //返回物联网相关的字段
97
+ iotFields: async (lamp: HeatLamp): Promise<any> => {
98
+ var axios = await this.context.ready;
99
+ return axios.post(
100
+ `/api/v1/pigfarm/heatLamp/iotFields/${lamp.id}`
101
+ );
102
+ },
96
103
  //开关,传入id或对象,action为on或off
97
104
  switch: async (lamp: HeatLamp | number, action: "on" | "off") => {
98
105
  var axios = await this.context.ready;
package/readme.md CHANGED
@@ -86,6 +86,7 @@ baseURL: "/"
86
86
  | cpzxrobot().pigfarm.unitStat | 获得单元的统计信息,包括每日料耗,饲料消耗,日龄,存栏量等 |
87
87
  | cpzxrobot().pigfarm.heatlamp.set | 设置保温灯的当前工作日龄,调用时,action传"dayage",argc传天数 |
88
88
  | cpzxrobot().pigfarm.heatlamp.switch | 设置保温灯的当前工作日龄,调用时,action"on"或"off" |
89
+ | cpzxrobot().pigfarm.heatlamp.iotFields | 获取保温灯用于获取iot的字段列表 |
89
90
 
90
91
 
91
92
  ### 工厂信息接口