@cpzxrobot/sdk 1.0.13 → 1.0.15
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.
|
@@ -46,7 +46,7 @@ export class FeedTowerGateway extends DeviceFilter<FeedTower> {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
wrapList(list: FeedTower[]): Promise<FeedTower[]> {
|
|
49
|
-
const ids =
|
|
49
|
+
const ids = list.map((device) => device.id)
|
|
50
50
|
//TODO 其他设备的详情需要支持,目前只有喂料塔
|
|
51
51
|
return this.context.axios
|
|
52
52
|
.post('/api/v1/pigfarm/device/status/list', ids)
|
|
@@ -41,7 +41,7 @@ class FeedTowerGateway extends device_filter_1.DeviceFilter {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
wrapList(list) {
|
|
44
|
-
const ids =
|
|
44
|
+
const ids = list.map((device) => device.id);
|
|
45
45
|
//TODO 其他设备的详情需要支持,目前只有喂料塔
|
|
46
46
|
return this.context.axios
|
|
47
47
|
.post('/api/v1/pigfarm/device/status/list', ids)
|
package/package.json
CHANGED
package/pigfarm_gateway.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Cpzxrobot, Unit } from ".";
|
|
2
2
|
|
|
3
3
|
export class PigfarmGateway extends Object {
|
|
4
|
-
context: Cpzxrobot
|
|
4
|
+
context: Cpzxrobot;
|
|
5
5
|
constructor(context: Cpzxrobot) {
|
|
6
|
-
super()
|
|
7
|
-
this.context = context
|
|
6
|
+
super();
|
|
7
|
+
this.context = context;
|
|
8
8
|
}
|
|
9
9
|
//获得日龄
|
|
10
10
|
dayageForUnit(unit: Unit) {
|
|
@@ -12,4 +12,11 @@ export class PigfarmGateway extends Object {
|
|
|
12
12
|
return axios.get(`/api/v1/pigfarm/${unit.id}/dayage`);
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
//获得存栏量
|
|
17
|
+
pigCountForUnit(unit: Unit) {
|
|
18
|
+
return this.context.ready.then((axios) => {
|
|
19
|
+
return axios.get(`/api/v1/pigfarm/${unit.id}/pigcount`);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
15
22
|
}
|