@cpzxrobot/sdk 1.0.12 → 1.0.14
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_filter.ts
CHANGED
|
@@ -309,11 +309,8 @@ export abstract class DeviceFilter<T extends { id: number }> {
|
|
|
309
309
|
if (res.data.Error) {
|
|
310
310
|
throw res.data.Error;
|
|
311
311
|
} else {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
this.devices = res.data;
|
|
315
|
-
}
|
|
316
|
-
return res.data;
|
|
312
|
+
return this.wrapList(res.data);
|
|
313
|
+
// return res.data;
|
|
317
314
|
}
|
|
318
315
|
});
|
|
319
316
|
}
|
|
@@ -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)
|
package/dist/device_filter.js
CHANGED
|
@@ -241,11 +241,8 @@ class DeviceFilter {
|
|
|
241
241
|
throw res.data.Error;
|
|
242
242
|
}
|
|
243
243
|
else {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
this.devices = res.data;
|
|
247
|
-
}
|
|
248
|
-
return res.data;
|
|
244
|
+
return this.wrapList(res.data);
|
|
245
|
+
// return res.data;
|
|
249
246
|
}
|
|
250
247
|
});
|
|
251
248
|
}
|
|
@@ -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)
|