@cpzxrobot/sdk 1.1.21 → 1.1.22

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.
@@ -259,6 +259,20 @@ class PigfarmGateway extends Object {
259
259
  var axios = await this.context.ready;
260
260
  return axios.post(`/api/v1/pigfarm/heatLamp/config/update`, lamp);
261
261
  },
262
+ updateByUnit: async (unit, lamp) => {
263
+ var axios = await this.context.ready;
264
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, lamp);
265
+ },
266
+ switchByUnit: async (unit, action) => {
267
+ var axios = await this.context.ready;
268
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/switch`, {
269
+ action,
270
+ });
271
+ },
272
+ taskStatus: async (no) => {
273
+ var axios = await this.context.ready;
274
+ return axios.post(`/api/v1/pigfarm/heatLamp/task/${no}`);
275
+ },
262
276
  control: async (lamp, action) => {
263
277
  var axios = await this.context.ready;
264
278
  var id = typeof lamp === "number" ? lamp : lamp.id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -318,6 +318,20 @@ export class PigfarmGateway extends Object {
318
318
  var axios = await this.context.ready;
319
319
  return axios.post(`/api/v1/pigfarm/heatLamp/config/update`, lamp);
320
320
  },
321
+ updateByUnit: async (unit: Unit,lamp: HeatLamp): Promise<any> => {
322
+ var axios = await this.context.ready;
323
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, lamp);
324
+ },
325
+ switchByUnit: async (unit: Unit, action: "on" | "off"): Promise<any> => {
326
+ var axios = await this.context.ready;
327
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/switch`, {
328
+ action,
329
+ });
330
+ },
331
+ taskStatus: async (no: String): Promise<any> => {
332
+ var axios = await this.context.ready;
333
+ return axios.post(`/api/v1/pigfarm/heatLamp/task/${no}`);
334
+ },
321
335
  control: async (lamp: HeatLamp | number, action: "on" | "off") => {
322
336
  var axios = await this.context.ready;
323
337
  var id = typeof lamp === "number" ? lamp : lamp.id;
package/readme.md CHANGED
@@ -122,6 +122,9 @@ baseURL: "/"
122
122
  | cpzxrobot().pigfarm.heatlamp.set | 设置保温灯的当前工作日龄,调用时,action传"dayage",argc传天数 |
123
123
  | cpzxrobot().pigfarm.heatlamp.switch | 设置保温灯的当前工作日龄,调用时,action"on"或"off" |
124
124
  | cpzxrobot().pigfarm.heatlamp.iotFields | 获取保温灯用于获取iot的字段列表 |
125
+ | cpzxrobot().pigfarm.heatlamp.switchByUnit | 按单元id开关,返回task |
126
+ | cpzxrobot().pigfarm.heatlamp.updateByUnit | 按单元id设置保温灯的参数,返回task |
127
+ | cpzxrobot().pigfarm.heatlamp.taskStatus | 获取保温灯的任务状态,传入taskId参数 |
125
128
  | cpzxrobot().pigfarm.heatlamp.template.add | 添加保温灯的模板 |
126
129
  | cpzxrobot().pigfarm.heatlamp.template.list | 获取保温灯的模板列表 |
127
130
  | cpzxrobot().pigfarm.threshold | 获取单元中特定类型的阈值信息 |