@cpzxrobot/sdk 1.1.4 → 1.1.5
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/dist/pigfarm_gateway.js +13 -0
- package/package.json +1 -1
- package/pigfarm_gateway.ts +19 -0
- package/readme.md +2 -0
package/dist/pigfarm_gateway.js
CHANGED
|
@@ -198,6 +198,19 @@ class PigfarmGateway extends Object {
|
|
|
198
198
|
var axios = await this.context.ready;
|
|
199
199
|
return axios.post(`/api/v1/pigfarm/heatLamp/config/list?unitId=${unit.id}`);
|
|
200
200
|
},
|
|
201
|
+
template: {
|
|
202
|
+
//获取配置模版列表
|
|
203
|
+
list: async (factory) => {
|
|
204
|
+
var axios = await this.context.ready;
|
|
205
|
+
return axios.get(`/api/v1/pigfarm/heatLamp/config/template/list/${factory.id}`);
|
|
206
|
+
},
|
|
207
|
+
//增加模板
|
|
208
|
+
add: (factory, name, data) => {
|
|
209
|
+
return this.context.ready.then((axios) => {
|
|
210
|
+
return axios.post(`/api/v1/pigfarm/heatLamp/config/add`, Object.assign(Object.assign({}, data), { factoryId: factory.id, templateName: name }));
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
},
|
|
201
214
|
list: async (unit) => {
|
|
202
215
|
var axios = await this.context.ready;
|
|
203
216
|
return axios.post(`/api/v1/pigfarm/heatLamp/list/${unit.id}`);
|
package/package.json
CHANGED
package/pigfarm_gateway.ts
CHANGED
|
@@ -247,6 +247,25 @@ export class PigfarmGateway extends Object {
|
|
|
247
247
|
`/api/v1/pigfarm/heatLamp/config/list?unitId=${unit.id}`
|
|
248
248
|
);
|
|
249
249
|
},
|
|
250
|
+
template: {
|
|
251
|
+
//获取配置模版列表
|
|
252
|
+
list: async (factory: Factory): Promise<any> => {
|
|
253
|
+
var axios = await this.context.ready;
|
|
254
|
+
return axios.get(
|
|
255
|
+
`/api/v1/pigfarm/heatLamp/config/template/list/${factory.id }`
|
|
256
|
+
);
|
|
257
|
+
},
|
|
258
|
+
//增加模板
|
|
259
|
+
add: (factory: Factory, name:String,data: HeatLamp) => {
|
|
260
|
+
return this.context.ready.then((axios) => {
|
|
261
|
+
return axios.post(`/api/v1/pigfarm/heatLamp/config/add`, {
|
|
262
|
+
...data,
|
|
263
|
+
factoryId: factory.id,
|
|
264
|
+
templateName: name,
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
},
|
|
268
|
+
},
|
|
250
269
|
list: async (unit: Unit): Promise<any> => {
|
|
251
270
|
var axios = await this.context.ready;
|
|
252
271
|
return axios.post(`/api/v1/pigfarm/heatLamp/list/${unit.id}`);
|
package/readme.md
CHANGED
|
@@ -112,6 +112,8 @@ baseURL: "/"
|
|
|
112
112
|
| cpzxrobot().pigfarm.heatlamp.set | 设置保温灯的当前工作日龄,调用时,action传"dayage",argc传天数 |
|
|
113
113
|
| cpzxrobot().pigfarm.heatlamp.switch | 设置保温灯的当前工作日龄,调用时,action"on"或"off" |
|
|
114
114
|
| cpzxrobot().pigfarm.heatlamp.iotFields | 获取保温灯用于获取iot的字段列表 |
|
|
115
|
+
| cpzxrobot().pigfarm.heatlamp.template.add | 添加保温灯的模板 |
|
|
116
|
+
| cpzxrobot().pigfarm.heatlamp.template.list | 获取保温灯的模板列表 |
|
|
115
117
|
| cpzxrobot().pigfarm.threshold | 获取单元中特定类型的阈值信息 |
|
|
116
118
|
| cpzxrobot().scanQrcode | 调用扫码功能,获得扫码文字 |
|
|
117
119
|
| cpzxrobot().vibrate | 调用震动功能 |
|