@cpzxrobot/sdk 1.0.63 → 1.0.65
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/device_types/feedtower.ts +14 -0
- package/dist/device_types/feedtower.js +6 -0
- package/dist/index.js +8 -0
- package/index.ts +10 -0
- package/package.json +1 -1
- package/readme.md +2 -0
|
@@ -131,6 +131,20 @@ export class FeedTowerGateway extends DeviceFilter<FeedTower> {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
async updateAlarmParam(
|
|
135
|
+
deviceId: number,
|
|
136
|
+
param: {
|
|
137
|
+
zeroPeriod: number;
|
|
138
|
+
zeroValue: number;
|
|
139
|
+
alertDays: number[];
|
|
140
|
+
}
|
|
141
|
+
) {
|
|
142
|
+
return this.context.axios.post(`/api/v2/device/config/feedTowerAlert/update`, {
|
|
143
|
+
deviceId,
|
|
144
|
+
config: param,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
134
148
|
//获取报警参数
|
|
135
149
|
async getAlarmParam(deviceId: number) {
|
|
136
150
|
return this.context.axios.get(`/api/v2/device/config/feedTowerAlert/${deviceId}`);
|
|
@@ -106,6 +106,12 @@ class FeedTowerGateway extends device_filter_1.DeviceFilter {
|
|
|
106
106
|
config: param,
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
async updateAlarmParam(deviceId, param) {
|
|
110
|
+
return this.context.axios.post(`/api/v2/device/config/feedTowerAlert/update`, {
|
|
111
|
+
deviceId,
|
|
112
|
+
config: param,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
109
115
|
//获取报警参数
|
|
110
116
|
async getAlarmParam(deviceId) {
|
|
111
117
|
return this.context.axios.get(`/api/v2/device/config/feedTowerAlert/${deviceId}`);
|
package/dist/index.js
CHANGED
|
@@ -93,6 +93,8 @@ class Cpzxrobot {
|
|
|
93
93
|
// @ts-ignore
|
|
94
94
|
this._jumpToMiniApp = window.miniapp.open;
|
|
95
95
|
// @ts-ignore
|
|
96
|
+
this._scanQrcode = window.miniapp.scanQrcode;
|
|
97
|
+
// @ts-ignore
|
|
96
98
|
this.setTitle = window.miniapp.setTitle;
|
|
97
99
|
// @ts-ignore
|
|
98
100
|
this.saveBase64 = window.miniapp.saveBase64;
|
|
@@ -113,6 +115,9 @@ class Cpzxrobot {
|
|
|
113
115
|
this._jumpToMiniApp = function (url) {
|
|
114
116
|
return platform.callHandler("app.openMiniapp", url);
|
|
115
117
|
};
|
|
118
|
+
this._scanQrcode = function () {
|
|
119
|
+
return platform.callHandler("app.scanQrcode");
|
|
120
|
+
};
|
|
116
121
|
this.setTitle = function (title) {
|
|
117
122
|
platform.callHandler("app.setTitle", title);
|
|
118
123
|
};
|
|
@@ -205,6 +210,9 @@ class Cpzxrobot {
|
|
|
205
210
|
dict(dictName) {
|
|
206
211
|
return this.axios.get(`/api/v1/dict/${dictName}`);
|
|
207
212
|
}
|
|
213
|
+
scanQrcode() {
|
|
214
|
+
return this._scanQrcode();
|
|
215
|
+
}
|
|
208
216
|
//打开其他小程序
|
|
209
217
|
openMiniApp(url) {
|
|
210
218
|
this._jumpToMiniApp(url);
|
package/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ export class Cpzxrobot {
|
|
|
32
32
|
_getSelectedFarmFromMiniApp!: () => any;
|
|
33
33
|
_getSelectedUnitFromMiniApp!: () => any;
|
|
34
34
|
_jumpToMiniApp!: (url: string) => any;
|
|
35
|
+
_scanQrcode!:() => Promise<string>;
|
|
35
36
|
setTitle!: (title: string) => void;
|
|
36
37
|
saveBase64!: (base64: string, filename: string) => void;
|
|
37
38
|
saveBlob!: (blob: Blob, filename: string) => void;
|
|
@@ -120,6 +121,8 @@ export class Cpzxrobot {
|
|
|
120
121
|
// @ts-ignore
|
|
121
122
|
this._jumpToMiniApp = window.miniapp.open;
|
|
122
123
|
// @ts-ignore
|
|
124
|
+
this._scanQrcode = window.miniapp.scanQrcode;
|
|
125
|
+
// @ts-ignore
|
|
123
126
|
this.setTitle = window.miniapp.setTitle;
|
|
124
127
|
// @ts-ignore
|
|
125
128
|
this.saveBase64 = window.miniapp.saveBase64;
|
|
@@ -143,6 +146,9 @@ export class Cpzxrobot {
|
|
|
143
146
|
this._jumpToMiniApp = function (url: string) {
|
|
144
147
|
return platform.callHandler("app.openMiniapp", url);
|
|
145
148
|
};
|
|
149
|
+
this._scanQrcode = function(){
|
|
150
|
+
return platform.callHandler("app.scanQrcode");
|
|
151
|
+
}
|
|
146
152
|
this.setTitle = function (title: string) {
|
|
147
153
|
platform.callHandler("app.setTitle", title);
|
|
148
154
|
};
|
|
@@ -241,6 +247,10 @@ export class Cpzxrobot {
|
|
|
241
247
|
return this.axios.get(`/api/v1/dict/${dictName}`);
|
|
242
248
|
}
|
|
243
249
|
|
|
250
|
+
scanQrcode(){
|
|
251
|
+
return this._scanQrcode();
|
|
252
|
+
}
|
|
253
|
+
|
|
244
254
|
//打开其他小程序
|
|
245
255
|
openMiniApp(url: string) {
|
|
246
256
|
this._jumpToMiniApp(url);
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -88,11 +88,13 @@ baseURL: "/"
|
|
|
88
88
|
| cpzxrobot().pigfarm.heatlamp.xxx | 操作保温灯 |
|
|
89
89
|
| cpzxrobot().device.feedTower.stat | 获得料塔设备的料耗,饲料重量 |
|
|
90
90
|
| cpzxrobot().device.feedTower.setAlarmParam | 设置料塔设备的报警参数 |
|
|
91
|
+
| cpzxrobot().device.feedTower.updateAlarmParam | 更新料塔设备的报警参数 |
|
|
91
92
|
| cpzxrobot().device.feedTower.getAlarmParam | 获得料塔设备的报警参数 |
|
|
92
93
|
| cpzxrobot().pigfarm.unitStat | 获得单元的统计信息,包括每日料耗,饲料消耗,日龄,存栏量等 |
|
|
93
94
|
| cpzxrobot().pigfarm.heatlamp.set | 设置保温灯的当前工作日龄,调用时,action传"dayage",argc传天数 |
|
|
94
95
|
| cpzxrobot().pigfarm.heatlamp.switch | 设置保温灯的当前工作日龄,调用时,action"on"或"off" |
|
|
95
96
|
| cpzxrobot().pigfarm.heatlamp.iotFields | 获取保温灯用于获取iot的字段列表 |
|
|
97
|
+
| cpzxrobot().scanQrcode | 调用扫码功能,获得扫码文字 |
|
|
96
98
|
|
|
97
99
|
|
|
98
100
|
### 工厂信息接口
|