@cpzxrobot/sdk 1.1.25 → 1.1.26

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.
@@ -263,11 +263,15 @@ class PigfarmGateway extends Object {
263
263
  var axios = await this.context.ready;
264
264
  return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, lamp);
265
265
  },
266
- switchByUnit: async (unit, action) => {
266
+ switchByUnit: async (unit, action, ids = null) => {
267
267
  var axios = await this.context.ready;
268
- return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/switch`, {
268
+ var args = {
269
269
  action,
270
- });
270
+ };
271
+ if (ids) {
272
+ args["ids"] = ids;
273
+ }
274
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/switch`, args);
271
275
  },
272
276
  taskStatus: async (args) => {
273
277
  var axios = await this.context.ready;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -322,11 +322,18 @@ export class PigfarmGateway extends Object {
322
322
  var axios = await this.context.ready;
323
323
  return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, lamp);
324
324
  },
325
- switchByUnit: async (unit: Unit, action: "on" | "off"): Promise<any> => {
325
+ switchByUnit: async (unit: Unit, action: "on" | "off",ids:Number[]|null = null): Promise<any> => {
326
326
  var axios = await this.context.ready;
327
- return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/switch`, {
327
+ var args:{
328
+ action: "on" | "off",
329
+ ids?:Number[]
330
+ } = {
328
331
  action,
329
- });
332
+ }
333
+ if (ids) {
334
+ args["ids"] = ids;
335
+ }
336
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/switch`, args);
330
337
  },
331
338
  taskStatus: async (args:{
332
339
  id?:number,