@cpzxrobot/sdk 1.3.57 → 1.3.58
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 +5 -0
- package/package.json +1 -1
- package/pigfarm_gateway.ts +5 -0
package/dist/pigfarm_gateway.js
CHANGED
|
@@ -259,10 +259,15 @@ 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
|
+
//用于设置保温灯分组,TODO : 应该有更直观的命名
|
|
262
263
|
updateByUnit: async (unit, lamp, ids = null) => {
|
|
263
264
|
var axios = await this.context.ready;
|
|
264
265
|
return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, Object.assign(Object.assign({}, lamp), { ids }));
|
|
265
266
|
},
|
|
267
|
+
deleteGroup: async (id) => {
|
|
268
|
+
var axios = await this.context.ready;
|
|
269
|
+
return axios.post(`/api/v1/pigfarm/heatLamp/deleteGroup?id=${id}`);
|
|
270
|
+
},
|
|
266
271
|
switchByUnit: async (unit, action, ids = null) => {
|
|
267
272
|
var axios = await this.context.ready;
|
|
268
273
|
var args = {
|
package/package.json
CHANGED
package/pigfarm_gateway.ts
CHANGED
|
@@ -318,6 +318,7 @@ 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
|
+
//用于设置保温灯分组,TODO : 应该有更直观的命名
|
|
321
322
|
updateByUnit: async (unit: Unit, lamp: HeatLamp, ids: Number[] | null = null): Promise<any> => {
|
|
322
323
|
var axios = await this.context.ready;
|
|
323
324
|
return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, {
|
|
@@ -325,6 +326,10 @@ export class PigfarmGateway extends Object {
|
|
|
325
326
|
ids
|
|
326
327
|
});
|
|
327
328
|
},
|
|
329
|
+
deleteGroup: async (id: any): Promise<any> => {
|
|
330
|
+
var axios = await this.context.ready;
|
|
331
|
+
return axios.post(`/api/v1/pigfarm/heatLamp/deleteGroup?id=${id}`);
|
|
332
|
+
},
|
|
328
333
|
switchByUnit: async (unit: Unit, action: "on" | "off", ids: Number[] | null = null): Promise<any> => {
|
|
329
334
|
var axios = await this.context.ready;
|
|
330
335
|
var args: {
|