@cpzxrobot/sdk 1.0.36 → 1.0.37

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.
@@ -44,5 +44,26 @@ class PigfarmGateway extends Object {
44
44
  });
45
45
  });
46
46
  }
47
+ get heatlamp() {
48
+ return {
49
+ add: (unit, data) => {
50
+ return this.context.ready.then((axios) => {
51
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/add`, Object.assign(Object.assign({}, data), { unitId: unit.id }));
52
+ });
53
+ },
54
+ list: async (unit) => {
55
+ var axios = await this.context.ready;
56
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/list?unitId=${unit.id}`);
57
+ },
58
+ get: async (id) => {
59
+ var axios = await this.context.ready;
60
+ return axios.get(`/api/v1/pigfarm/heatLamp/config/${id}`);
61
+ },
62
+ update: async (lamp) => {
63
+ var axios = await this.context.ready;
64
+ return axios.get(`/api/v1/pigfarm/heatLamp/config/update`, lamp);
65
+ },
66
+ };
67
+ }
47
68
  }
48
69
  exports.PigfarmGateway = PigfarmGateway;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- import { Cpzxrobot, Unit } from ".";
1
+ import { Cpzxrobot, HeatLamp, Unit } from ".";
2
2
 
3
3
  export class PigfarmGateway extends Object {
4
4
  context: Cpzxrobot;
@@ -52,4 +52,29 @@ export class PigfarmGateway extends Object {
52
52
  });
53
53
  });
54
54
  }
55
+
56
+ get heatlamp() {
57
+ return {
58
+ add: (unit:Unit, data: HeatLamp) => {
59
+ return this.context.ready.then((axios) => {
60
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/add`, {
61
+ ...data,
62
+ unitId: unit.id,
63
+ });
64
+ });
65
+ },
66
+ list: async (unit:Unit):Promise<any>=> {
67
+ var axios = await this.context.ready;
68
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/list?unitId=${unit.id}`)
69
+ },
70
+ get: async (id: number):Promise<any>=> {
71
+ var axios = await this.context.ready;
72
+ return axios.get(`/api/v1/pigfarm/heatLamp/config/${id}`)
73
+ },
74
+ update:async (lamp: HeatLamp):Promise<any>=> {
75
+ var axios = await this.context.ready;
76
+ return axios.get(`/api/v1/pigfarm/heatLamp/config/update`,lamp)
77
+ },
78
+ };
79
+ }
55
80
  }
package/readme.md CHANGED
@@ -81,6 +81,8 @@ baseURL: "/"
81
81
  | cpzxrobot().camera.xxx | 获得摄像头的相关信息 |
82
82
  | cpzxrobot().factory.entry| 获得工厂的可显示动态信息 |
83
83
  | cpzxrobot().transport.fodder.getDeviceByFodderld | 获得料单对应的设备 |
84
+ | cpzxrobot().pigfarm.heatlamp.xxx | 操作保温灯 |
85
+
84
86
 
85
87
  ### 工厂信息接口
86
88
 
package/types.d.ts CHANGED
@@ -79,6 +79,27 @@ type Unit = {
79
79
  workshopName?: string;
80
80
  };
81
81
 
82
+ type HeatLamp = {
83
+ id: number;
84
+ unitId: number;
85
+ lampLine: number;
86
+ lampColumn: number;
87
+ startDate: string;
88
+ //运行天数
89
+ runDays: number;
90
+ workMode: "auto" | "manual";
91
+ //   告警阈值下限
92
+ alarmLower: number;
93
+ //   告警阈值上限
94
+ alarmUpper: number;
95
+ // 环境温度补偿值
96
+ tempCompensation: number;
97
+ periodList: {
98
+ startTemp: number,
99
+ startDayage: number,
100
+ }[]
101
+ }
102
+
82
103
  type Electricity = {
83
104
  deviceId: string;
84
105
  nextDeviceList: number[] | [];