@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -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 | 调用震动功能 |