@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.
- package/dist/pigfarm_gateway.js +7 -3
- package/package.json +1 -1
- package/pigfarm_gateway.ts +10 -3
package/dist/pigfarm_gateway.js
CHANGED
|
@@ -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
|
-
|
|
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
package/pigfarm_gateway.ts
CHANGED
|
@@ -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
|
-
|
|
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,
|