@cpzxrobot/sdk 1.0.43 → 1.0.44

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.
@@ -63,6 +63,14 @@ class PigfarmGateway extends Object {
63
63
  var axios = await this.context.ready;
64
64
  return axios.post(`/api/v1/pigfarm/heatLamp/config/update`, lamp);
65
65
  },
66
+ control: async (lamp, action) => {
67
+ var axios = await this.context.ready;
68
+ var id = typeof lamp === "number" ? lamp : lamp.id;
69
+ return axios.post(`/api/v1/pigfarm/heatLamp/control`, {
70
+ id,
71
+ action,
72
+ });
73
+ },
66
74
  };
67
75
  }
68
76
  }
@@ -15,6 +15,7 @@ class TransportGateway extends Object {
15
15
  pageSize: 10,
16
16
  deviceId: id,
17
17
  unitId: undefined,
18
+ factoryId: undefined,
18
19
  }) => {
19
20
  return this.context.ready.then(() => {
20
21
  return this.context.axios
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -55,7 +55,7 @@ export class PigfarmGateway extends Object {
55
55
 
56
56
  get heatlamp() {
57
57
  return {
58
- add: (unit:Unit, data: HeatLamp) => {
58
+ add: (unit: Unit, data: HeatLamp) => {
59
59
  return this.context.ready.then((axios) => {
60
60
  return axios.post(`/api/v1/pigfarm/heatLamp/config/add`, {
61
61
  ...data,
@@ -63,17 +63,27 @@ export class PigfarmGateway extends Object {
63
63
  });
64
64
  });
65
65
  },
66
- list: async (unit:Unit):Promise<any>=> {
66
+ list: async (unit: Unit): Promise<any> => {
67
67
  var axios = await this.context.ready;
68
- return axios.post(`/api/v1/pigfarm/heatLamp/config/list?unitId=${unit.id}`)
68
+ return axios.post(
69
+ `/api/v1/pigfarm/heatLamp/config/list?unitId=${unit.id}`
70
+ );
69
71
  },
70
- get: async (id: number):Promise<any>=> {
72
+ get: async (id: number): Promise<any> => {
71
73
  var axios = await this.context.ready;
72
- return axios.get(`/api/v1/pigfarm/heatLamp/config/${id}`)
74
+ return axios.get(`/api/v1/pigfarm/heatLamp/config/${id}`);
73
75
  },
74
- update:async (lamp: HeatLamp):Promise<any>=> {
76
+ update: async (lamp: HeatLamp): Promise<any> => {
75
77
  var axios = await this.context.ready;
76
- return axios.post(`/api/v1/pigfarm/heatLamp/config/update`,lamp)
78
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/update`, lamp);
79
+ },
80
+ control: async (lamp: HeatLamp | number, action: "on" | "off") => {
81
+ var axios = await this.context.ready;
82
+ var id = typeof lamp === "number" ? lamp : lamp.id;
83
+ return axios.post(`/api/v1/pigfarm/heatLamp/control`, {
84
+ id,
85
+ action,
86
+ });
77
87
  },
78
88
  };
79
89
  }
@@ -19,11 +19,13 @@ export class TransportGateway extends Object {
19
19
  pageSize: number;
20
20
  deviceId: number | undefined;
21
21
  unitId: number | undefined;
22
+ factoryId: number | undefined;
22
23
  } = {
23
24
  current: 1,
24
25
  pageSize: 10,
25
26
  deviceId: id,
26
27
  unitId: undefined,
28
+ factoryId: undefined,
27
29
  }
28
30
  ): Promise<FodderOrder[]> => {
29
31
  return this.context.ready.then(() => {