@cpzxrobot/sdk 1.1.26 → 1.1.27
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 +2 -2
- package/package.json +1 -1
- package/pigfarm_gateway.ts +5 -2
package/dist/pigfarm_gateway.js
CHANGED
|
@@ -259,9 +259,9 @@ 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) => {
|
|
262
|
+
updateByUnit: async (unit, lamp, ids = null) => {
|
|
263
263
|
var axios = await this.context.ready;
|
|
264
|
-
return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, lamp);
|
|
264
|
+
return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, Object.assign(Object.assign({}, lamp), { ids }));
|
|
265
265
|
},
|
|
266
266
|
switchByUnit: async (unit, action, ids = null) => {
|
|
267
267
|
var axios = await this.context.ready;
|
package/package.json
CHANGED
package/pigfarm_gateway.ts
CHANGED
|
@@ -318,9 +318,12 @@ 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> => {
|
|
321
|
+
updateByUnit: async (unit: Unit,lamp: HeatLamp,ids:Number[]|null = null): Promise<any> => {
|
|
322
322
|
var axios = await this.context.ready;
|
|
323
|
-
return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`,
|
|
323
|
+
return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, {
|
|
324
|
+
...lamp,
|
|
325
|
+
ids
|
|
326
|
+
});
|
|
324
327
|
},
|
|
325
328
|
switchByUnit: async (unit: Unit, action: "on" | "off",ids:Number[]|null = null): Promise<any> => {
|
|
326
329
|
var axios = await this.context.ready;
|